JSFiddle - React, Tailwind, and code Playground
by Luiza CICONE
HTML
<div ng-app="" ng-controller="BMWController">
My name is {{ name }} and I am a {{ type }}
<button ng-click="clickme()">Click Me</button>
</div>
JavaScript
function CarController($http, $scope, foo) {
$scope.name = 'Car';
$scope.type = 'Car';
console.log(foo);
$scope.clickme = function() {
alert('This is parent controller "CarController" calling');
}
}
function BMWController($scope, $injector) {
var a = {c:"tsts"};
$injector.invoke(CarController, a, {$scope: $scope, foo: this});
$scope.name = 'BMW';
console.log(this);
}