I have a controller defined inside a module:
angular.module('myModule').controller('MyCtrl', function ($scope) {
$scope.property = 'myproperty'; });
A partial is included in the main html like this:
<div ng-include src="'partial/mypartial.html'"></div>
Is it possible to reference MyCtrl inside mypartial.html? e.g. somehow like this:
<div ng-controller="myModule.MyCtrl">
Thanks!
Given the angular javascript:
angular.module('myModule').controller('MyCtrl', function ($scope) {
$scope.property = 'myproperty'; });
Your view setup should look something like:
<html ng-app>
<head>
</head>
<body>
<div ng-controller="MyCtrl">
{{property}}
</div>
</body>
</html>
The above code should generate:
myproperty