TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
tri_inn
NA
1.2k
232.9k
AngularJS: What compile function does
May 24 2017 5:58 AM
i am new in angular js.
just like to know about few line like what they does.
app.directive(
'fancybox'
, function($compile) {
return
{
restrict:
'A'
,
replace:
false
,
link: function($scope, element, attrs) {
$scope.open_fancybox = function() {
var el = angular.element(element.html()),
compiled = $compile(el);
$.fancybox.open(el);
compiled($scope);
};
}
};
});
below these lines are not clear.
var el = angular.element(element.html()),
compiled = $compile(el);
$.fancybox.open(el);
compiled($scope);
1) what $compile does and what it return after compile ? 2) when we need to compile scope like compiled($scope);
i have test the if i comment this line compiled($scope); then value is not putting into expression.......why ?
please guide me in detail. thanks
Reply
Answers (
2
)
How to use visual studio code in visual studio 2017??
angularjs: when button click open browser manage add-ons ..?