# $controller 继承

有的时候需要继承关系，来解决重复代码，通过`$controller`就可以解决

```javascript
var app = angular.module('angularjs-starter', []); 
app.controller('ParentCtrl ', function($scope) {
// I'm the sibling, but want to act as parent
});
app.controller('ChildCtrl', function($scope, $controller) {
$controller('ParentCtrl', {$scope: $scope}); //This works
});
```

## 资料

[AngularJS控制器继承自另一控制器](http://www.jb51.net/article/83836.htm)

[angularjs controller 继承](https://www.cnblogs.com/qiaojie/p/5721098.html)
