How to add a spinner while loading the content in AngularJS?

后端 未结 7 2065
谎友^
谎友^ 2021-01-02 02:09

I am using button spinner while loading the content, when the user clicks on the \"Search\" button content will load, at this time buttonLabel will be changed t

7条回答
  •  遥遥无期
    2021-01-02 02:48

    All you need to do is use ng-show or ng-hide directives.

    ng-show="expression"

    
        
    
    

    this span will only be visible when searchButtonText will be equal to a string 'Searching'.

    You should learn more about angular's directives. They'll be useful in future.

    Good luck.

    Demo http://jsfiddle.net/xc6nx235/16/

提交回复
热议问题