Method 1
In HTML:
<my-directive>
</my-directive>
In Scripts:
function myDirective() {
var ddo = {
[LOTS OF OTHER VERY IMPORTANT DIRECTIVE PROPERTIES HERE]
controller: myController
bindToController: true
};
return ddo;
}
Method 2
In HTML:
<my-directive ng-controller="myController">
</my-directive>
In Scripts:
function myDirective() {
var ddo = {
[LOTS OF VERY IMPORTANT DIRECTIVE PROPERTIES HERE]
};
return ddo;
}
Both cases there is a directive with some other properties (template, etc.) but I am just changing where I put controller. Are the two methods analogous?