I'm having difficulty getting Angular to work with partial postbacks in .Net.
My issue is similar to this question: Re-initialize Angular bindings after partial postback
The problem arises when switching between tabs - one containing an Angular app and the other a C# control. After a partial postback, returning to the Angular tab results in nothing being displayed.
I've tried using ngView routing and $route.reload(), but the template is pulled down without any effect on the page. I also attempted using compile(templateCache.get(lazyTableControllerRoute.current.templateUrl))(scope) as suggested here, but to no avail.
Any assistance would be greatly appreciated :)
After each postback, I add the following HTML to the page:
LiteralControl lazyControl = new LiteralControl("<div ng-app=\"LazyLoadingApp\" style=\"padding:10px\" ng-controller=\"LazyTableController\" ng-view><lazy-table> </lazy-table></div>");
Controls.Add(lazyControl);
Additionally, I include some configuration constants like templateUrl.
Here is my code :
(pre-review code omitted for brevity)UPDATE:
I attempted to use require.js... My goal was to bootstrap elements after a partial postback by creating a simple test case where a button triggers a partial postback within an Update Panel alongside my app. When the app disappeared after clicking, I tried the following in the console:
angular.bootstrap(document, ['LazyLoadingApp'])
However, I encountered an error that I couldn't resolve:
App Already Bootstrapped with this Element 'document'
Here is a plunker showcasing the app in a require.js setup (please note it's only for code review purposes).