Re-initialize Angular bindings after partial postb

2019-08-12 21:03发布

I am trying to infiltrate an ASP.NET page with some Angular goodness. The problem is that the page has some partial postbacks (Update Panels) that cause my Angular bindings to revert to curly bracket expressions {{ property }}. I can see that the scope is still there in the javascript console.

How do I re-initialize the angular functionality after an Update Panel response ends? I tried $digest and $apply on the scope, but my {{ property }} no longer has the two-way goodness.

(P.S. I will eventually be able to re-write all the postbacks using angular services, but I have a demo in a few days, so it's a mixed bag at the moment.)

1条回答
爷、活的狠高调
2楼-- · 2019-08-12 21:42

change the curly braces delimiters to something else in angularjs.

var myApp = angular.module('myApp', [], function($interpolateProvider) {
    $interpolateProvider.startSymbol('[[');
    $interpolateProvider.endSymbol(']]');
});
查看更多
登录 后发表回答