Page 1 of 1

Popular beginner problems: reload ng-view and close modal with ng-click event?

Posted: Sat Jun 06, 2015 4:33 pm
by Ma

How can I reload ng-view with ng-click event?
How can I close a modal with ng-click event?

I'm working with an ionic/angular project.


Popular beginner problems: reload ng-view and close modal with ng-click event?

Posted: Sat Jun 06, 2015 6:56 pm
by Illya Stepanov

Popular beginner problems: reload ng-view and close modal with ng-click event?

Posted: Sat Jun 06, 2015 9:26 pm
by Ma

I tried to do that but that reload all the page ;(


Popular beginner problems: reload ng-view and close modal with ng-click event?

Posted: Sun Jun 07, 2015 10:04 am
by Illya Stepanov

Could you please elaborate, what result you want to have?


Popular beginner problems: reload ng-view and close modal with ng-click event?

Posted: Sun Jun 07, 2015 6:32 pm
by Ma

I have some data from a database in ng-view so I created a button to reload this data if it has a new record. I added a function with location.refresh on ng-click to reload data but It's reload all the page.
May you can fix it?


Popular beginner problems: reload ng-view and close modal with ng-click event?

Posted: Mon Jun 15, 2015 11:10 am
by Illya Stepanov

Please use jQuery Mobile app template or explore AngularJS documentation deeply.

Basically in your case you need to call service that receives data once more and this service will renew data on screen.

If you're outputting data using standard directive ng-repeat from the storage, then you need just to update the data in the variable Scope.
And if you are not using standard services to receive data, then you'll need to call $scope.$apply().