Angular : ng-init does not run on load

前端 未结 2 2070
情深已故
情深已故 2021-02-19 19:27

I have seen a few exmaples on stack overflow about this ng-init issue, although I cant seem to find one which references it with the use of a controller.

I have called t

2条回答
  •  爱一瞬间的悲伤
    2021-02-19 20:03

    another option is using jquery. It would fit if you depend on many elements. But make sure to load jquery with a version of your choice to project. loading jquery (insert version where it's ...):

    
    

    the js code:

    $(document).ready(function() { 
            alert("do something");
        });
    

提交回复
热议问题