[removed] does not work in AngularJS

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

This code in a simple HTML file works:


         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 15:09

    the following should work:

    jQuery(function(){ /** my window onload functions **/ })

    since angular uses a subset of jquery anyways you also may include the real thing.

    better yet:
    Instead of using this, you may consider using the angular way of initialising things:

    that would be: http://docs.angularjs.org/api/ng.directive:ngInit

    < any ng-init="functionInController(something)"...

    to make it invisible until init: http://docs.angularjs.org/api/ng.directive:ngCloak

    < any ng-cloak .....

    to initialise/customize whole parts: http://docs.angularjs.org/guide/directive

    < any directive-name....

提交回复
热议问题