I am trying to implement a nested structure on my nested scope within a directive, as shown below:
angular.module('myAddress').directive('myAddress', [function () {
return {
restrict: 'AE',
controller: 'myAddressController',
templateUrl: 'my-address.html',
scope: {
address: {
'form': '=addressForm',
'model': '=addressModel'
}
}
};
}]);
However, I am encountering an exception stating that undefined is not a function when I have the address nesting in place. This exception does not occur when I remove the address nesting.
Is there a way to include attribute arguments inside a named key on my scope?
Addtionally, when I define $scope.address within the controller, it does not work either. I am wondering which will be executed first - the scope: { 'form' = 'addressForm'} part in my directive or the controller's $scope.form?