[removed] does not work in AngularJS

前端 未结 4 1733
耶瑟儿~
耶瑟儿~ 2020-12-16 14:20

This code in a simple HTML file works:


         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-16 15:10

    I prefer putting this kind of code in the app.run() function of angular.

    e.g.

    angular
    .module('testApp', ['someModule'])
    .constant('aConstant', 'hi')
    .config(function($rootProvider) {/*some routing here*/})
    .run(['$window', function($window) {
      $window.onload = function() {/*do your thing*/};
    }]);
    

    also check this nice post that depicts the order that some things happen in angular AngularJS app.run() documentation?

提交回复
热议问题