search

Home  >  Q&A  >  body text

angular.js - angularJs loading effect

Now I want to add the loading effect to the angular project: in the $http request of all pages, and when clicking the button, the loading effect is basically the global page. How should I do this?

高洛峰高洛峰2792 days ago692

reply all(2)I'll reply

  • 某草草

    某草草2017-05-15 17:11:21

    Look at this https://github.com/maseh87/ng...

    reply
    0
  • PHP中文网

    PHP中文网2017-05-15 17:11:21

    First make a loading p and keep showing it. If the $http request is successful, just change the show to hide

    font-awesome has several ready-made loading classes, which are more convenient to use than animation

    
            var loaderElement = $('<p/>', {
                class: 'player-loader',
            }).appendTo(root_);
            
            $('<i/>', {
                class: 'fa fa-spinner fa-pulse fa-5x fa-fw'
            }).appendTo(loaderElement);

    reply
    0
  • Cancelreply