I am encountering an issue with my controller
.controller('Main', ['$scope', function ($scope) {
$scope.uiState = {'name': 'test'};
}])
My directive is structured as follows
scope: {uiState: '='},
link: function(scope, element, attrs) {
console.log(scope.uiState) // showing as undefined
}
The way I am using it is
<my-dir uiState="uiState"> </my-dir>
I suspect that my directive is being compiled before the controller has a chance to populate the data.
Do you have any thoughts on this?
Upon checking in Firebug, I noticed the following error
Error: [$compile:nonassign] Expression 'undefined' used with directive 'my-dir' is non-assignable!