Answer the question
In order to leave comments, you need to log in
AngularJS, $compile when an event occurs, how to do?
There is an application with push State navigation, which is implemented on History.js. There is a news page, news is added by the usual ng-repeat. The goal is to get the news page and resume bindings. This is how I get the template:
$.getJSON(url, {}, function (data) {
if (data.status == 1) {
$('#container').html(data.template);
History.pushState({}, '', url);
}
})
app.directive('customHtml', function($compile, $http){
return {
link: function(scope, element) {
$http.get('template.html').then(function (result) {
element.html($compile(result.data)(scope));
});
}
}
})
Answer the question
In order to leave comments, you need to log in
There is an application with push State navigation, which is implemented on History.js.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question