Change view after make ajax call AngularJS -


I am developing a single page application with the help of AngularJS and I'm new to it, maybe my question is so primitive But at the moment I do not know how to handle it.

After logging in to the user's name and password, why do I need an ID to open a pop-up menu then an AJAX call on the server And if the user is certified that an un The scene (profile) is displayed.

This is my AJAX call

  formApp.controller ('main controller', function formCtrl ($ scope, $ http) {$ scope.processForm = function () { $ Http ({method: 'POST', url: 'login', data: $ .premium ($ scope.formData), header: {'Content-type': 'application / x-www-form-urlencoded'}} ) .success (function (data) {console.log (data);})}}  

and it has router and visual config:

  FormApp = angular.module ('formApp', ['ngRoute']); formApp.config (function ($ migration provider) {$ routeProvider. When ('/', {templateUrl: 'main', administrator: 'main controller'} ). ('/ Profile', {TemplateUrl: 'profile', 'administrator': profile Thank you in advance,   

> Now call the success method call: change back to $ location.path ('/ profile');

In addition, I think, You need some service where you will keep the user's data. Also, consider using NGRsource (or similar things) to work with the REST backend (and do not keep this argument in the controller).


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -