I am trying to do the below functionality which was using jQuery.load()

This gets content using post/get method and loads into a html element 
content.

As part of my conversion to angular...

I tried to use directive. The html content returned from server has some 
angular expressions like {{showlogin}} and {{'1234'}}

These expressions are not getting compiled.

msapp.directive("usersessionLogin",["$location","$http","$log","$compile",function($location,$http,$log,$compile){
return {
link:function(scope, element, attrs) {
$log.log(attrs); var o={};
$.each(attrs,function(k,v){
if(!k.startsWith("$")){
o[k]=v;
}
});
$http.post(app.contextPath+"/"+app.locale+"/usersession/login?fragment=true",o).success(function(data){
element.html(data);
element.append($compile(element.contents())(scope));
});
},
restrict: 'AE',
    templateNamespace: 'html',
    scope: false
};
}]);


Please help.


-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to