Vietnam

    Nodejs.vn

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Groups
    • Search

    anh chị nào rành $route reload giúp em với

    AngularJS
    0
    1
    453
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Long Đặng
      Long Đặng last edited by

      function thì đã chạy ổn rồi nên e để "........" cho nhanh. chỉ có cái $route.reload() là e ko chạy được. Nếu e dùng $window.location.reload thì chạy được nhưng e muốn sử dụng vì khi refresh trang thì nó ko còn đứng ở tab e đang đứng.

      Causes $route service to reload the current route even if $location hasn't changed.
      As a result of that, ngView creates new scope and reinstantiates the controller.

      var app = angular.module('ngRoute']);
      app.controller('wizardController', ['$scope', '$http' , '$route' , function($scope, $http, $route) {

      $scope.updateRoom = function(hotel_id){
      ...........

              $http.post("..........").then(function(response){
                 ...........
                  $route.reload();
              });
          }
      

      }]);

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      $(document).ready(function () { app.coldLoad(); }); }