angularjs - angular bootstraping doesn't work after browser refresh -



angularjs - angular bootstraping doesn't work after browser refresh -

i have unusual problem angular bootstraping. can't paste whole code shortly:

there's no ng-app in index.html there's jquery ajax check if i'm signed in

if i'm signed in - phone call (and it's ok):

angular.element('body').ready(function(){ angular.bootstrap(angular.element('body'),['app']); console.log('is called'); //is called })

if i'm not signed in do:

app = angular.injector(['app.templates']) content = app.get('$templatecache').get('login.html') $compile = app.get('$compile') $scope = app.get('$rootscope').$new(true) $('body').append content $compile($('body').contents())($scope) $scope.login = function() { // doing login ajax }

and works

in $scope.login function i'm doing ajax bootstraping angular app (code @ top) , it's ok in angular app have signout function doing simple jquey ajax phone call signout on server side after successfull signout i'm doing window.location.reload(true/false doesn't matter) , after reload see login form, login, angular app starts , is ok i'm logged in, have angular app, browser refresh (f5) - , it's ok (signup check, bootstrap)

the point is: while i'm signed out , page refresh (f5) page reloads, signup form visible after successful signup ajax angular isn't bootstraping page refresh doing signup check , bootstraping ok, signout doing window.location.reload() (which should equivalent f5) , successful signup bootstraping. thing - after successful signup changed angular bootstrap window.location.reload(true/false doesn't matter), page reloads , should signup check should result in bootstraping angular app not. have refresh page 1 time again , starts o_o

i have absolutely no thought do.

angularjs

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

java - Parsing XML, skip certain tags -

c# - ASP.NET MVC Sequence contains no matching element -