Skip to content

Instantly share code, notes, and snippets.

@vladdancer
Created December 2, 2013 09:11
Show Gist options
  • Save vladdancer/7746917 to your computer and use it in GitHub Desktop.
Save vladdancer/7746917 to your computer and use it in GitHub Desktop.
var myApp = angular.module('myApp',[]);
function Parent($scope) {
$scope.name = 'Superhero';
$scope.clickParent = function() {
$scope.name = 'Clicked from base controller';
}
}
function Child($scope, $injector) {
debugger;
$injector.invoke(Parent, this, {$scope: $scope});
$scope.name = 'Superhero Child';
$scope.clickChild = function(){
$scope.clickParent();
}
}
Child.prototype = Object.create(Parent.prototype);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment