angularjs - Login with AngulaJS -


i need implement following feature: whenever comes site, sees login form , if didn't logon correctly, other url should show him login form.

how can this?

i have project inherited , starting in angular, have no idea change first page show , how block unauthorized users accessing other urls

to keep explanation basic possible angular works in main index.html file using "controllers" explain client browser do. somewhere in folder hierarchy should folder named "partials" , "templates" , "views" ,or similar. should contain bunch of small .html files. files swapped using ajax embedded angular. there should html element tag contains attribute "ng-app= "whateveryourappsnameishere" within opening element tag, in between tag "angular."

angular seems complex @ first, once keep @ it gets easier. within ng-app attribute powered in js files, , there's free resources out there, including [codeschool] (http://campus.codeschool.com/courses/shaping-up-with-angular-js/intro) has one, , angular. google, hosts own "phonecat app" explains basics in pretty detail in walk-through tutorial code snippets provided when can't quite figure out. make sure use link though [google:angular - go "tutorial"] (https://angularjs.org/) there angular 2.0, written in typescript(short hand js) found @ fyi only: make sure you're not on domain know exists in event start liking typescript, i'd recommend sticking plain angular until you're comfortable it.

okay, that's brief splash of what's find files, , grasp answers bit better. @ least 2 resources start learning angular from.

for direct question "how manage users being logged in, or sending them page." there many ways perform task, i'll give guidance on how best learn in opinion. 1) review "ng-if" can use display/not display page section (or asked re-route login form if not verified) people typically seem use "router" angular, angular-ui recognized 1 , can find here: npm angular-ui-router. can verify on end when call out server page updates.

so know didn't directly answer question, links sent more answer question , give guidance start learning/looking resources from. if you're not yet familiar, recommend building/maintaining app in yeoman if have not done already. [yeoman] (http://http://yeoman.io/) , [yeoman - tutorial] (https://www.youtube.com/watch?v=gkialsjw5xi) <-- guy amazing tutorials, , he's reassuring when you're scratching head feeling overwhelmed coding things.

hope helps, that's 3 years worth of resources touted out in 1 question response. happy coding! ;)


Comments

Popular posts from this blog

dns - How To Use Custom Nameserver On Free Cloudflare? -

python - Pygame screen.blit not working -

c# - Web API response xml language -