I am trying to refresh a page with success in an angularjs controller.

I tried using $ state but nothing happens. I am new to angular

       $http({
             method:'PUT',
             url: '/api/resources,
             data:dataObject,
             headers: {'Content-Type': 'application/json'}
        }).success(function(data, status, headers, config){
            AppAlert.add('success', 'The appointment was updated successfully.', 5000);
            $state.go('.', {}, {reload: true});

      

+3


source to share


2 answers


you can use $route.reload()

to reload the current route or $window.location.reload()

for a complete refresh

you just need to introduce these services.



AngularJs: Refresh Page

+3


source


It looks like you are using ui-router

to use



$state.transitionTo($state.current, $stateParams, {
    reload: true,
    inherit: false,
    notify: true
});

      

+1


source







All Articles