Hi i was looking for answer all day... sory if it's a noob question i'm new in aJS. soo the problem is, i have simple controller
function SearchCtrl($scope, $http) {
$scope.url = 'search';
$scope.fetchContent = function() {
$
http.post($scope.url).success(function(data, $compile) {
console.log("SearchCtrl:post");
$scope.test = data;
}).error(function(data, status, headers, config) {
});
};
};
to get the data from post, then
then i have a directive to compile the data from backed
App.directive('angularHtmlBind', function( $compile) {
return function(scope, elm, attrs) {
function updateView(ret) {
elm.html($compile(ret)(scope));
}
scope.$watch(attrs.angularHtmlBind, function(value) {
updateView(value);
});
};
});
i get a from post JSP page where i want to bid JSP variables to java script model
...
<div ng-controller="ModelCtrl">
{{ setModelX(${searchCommand.nrOfElements}) }}
{{ getSize() }}
</div>
...
it's working but it's calling this method two times ???
from fire Bug console :
ModelCtrl
index.js (line 44)
log: getSize
i really don't understand why??
thanks