Reputation: 1
I have the following directive:
.directive('cmplt', function ($parse, $http, $sce, $timeout) {
return {
restrict: 'EA',
template: '<div><input id='{{id}}_fieldInpt' /></div id='{{id}}_dropDown'><div></div>'
link: function($scope, elem, attrs) {
//code here
}
}
What i want to do is observe/watch any changes in the {{id}}_dropDown div. How can i do it?
Upvotes: 0
Views: 49
Reputation: 575
You need just create the $scope in your link function.
.directive('angucomplete', function ($parse, $http, $sce, $timeout) {
return {
restrict: 'EA',
template: '<div><input id='{{id}}_fieldInpt' /></div id='{{id}}_dropDown'><div></div>'
link: function($scope, elem, attrs) {
$scope.id = 123;
}
}
Upvotes: 1