Combating AngularJS executing controller twice -
I understand that AngularJS runs twice through some code, sometimes even more like To put 2 records in my DB, it is executed twice, I am still clearly learning because I have beaten my head for ages against this I am doing App router resembles specified navigation to But I have also got the code in The problem has been solved by removing the This problem also appears when using tabbed navigation for example, This report tab can be HTML mail: This will also result in the controller running twice. $ watch
MyController :
$ routeProvider.when ('/', {templateUrl: 'pages / home.html', Controller: MyController});
home.html :
and
data-ng-controller attribute from the double-digested controller. Alternatively,
controller: could have been removed from the routing directive.
app.js can contain:
.state ('tab.reports', {url:' / reports', views: {'tab-reports': templates / tab-reports html', controller: 'reportscटल'}}})
& lt; Ion-View View-Title = "Report" & gt; & Lt; Ion-content ng-controller = "ReportCuttle" & gt;
Comments
Post a Comment