Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NicoleY77/a45020ef41e6f58402cf to your computer and use it in GitHub Desktop.
Save NicoleY77/a45020ef41e6f58402cf to your computer and use it in GitHub Desktop.
app.directive('upgrade1', function () {
return {
restrict: 'E',
templateUrl: "my_template.html",
scope: {
'info': '=info',
},
controller: 'upgrade1',
}
});
app.directive('upgrade2', function () {
return {
restrict: 'E',
templateUrl: "my_template.html",
scope: {
'info': '=info',
},
controller: 'upgrade2',
}
});
function baseCtrl ($scope, $rootScope, $timeout) {
$scope.penguins = "Black and White";
$rootScope.tigers = "Black and Orange";
$timeout(function () {
$scope.half_black_animals = $scope.penguins + $rootScope.tigers;
});
}
app.controller('upgrade1', function ($scope, $rootScope, $timeout) {
$injector.invoke(baseCtrl, this, {$scope:$scope, $rootScope:$rootScope, $timeout:$timeout});
});
app.controller('upgrade2', function ($scope, $rootScope, $timeout) {
$injector.invoke(baseCtrl, this, {$scope:$scope, $rootScope:$rootScope, $timeout:$timeout});
$scope.flamingos = "Pink Pink Pink";
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment