我不確定我是否使用正確的方法,請諮詢:
我有一個AngularJS應用程序,當用戶登錄後,我將從登錄頁面重定向到所需頁面。如何使用ui路由器重新加載所有應用程序模塊?
問題:
登錄按鈕,個人檔案相片沒有更新,因爲這2個元素是內部模塊.RUN和index.html,因爲兩者都是在工具欄裏面
如何我可以重新加載主應用程序(我不確定這是一個好方法),如果你有任何其他想法,它會很好。
內.RUN我試圖讓登錄後更新的個人主頁上,它擁有的地位和PIC:
auth.authenticate(localStorageService.get('profile'), token)
index.html中
我具備的要素:
<img ng-src="{{profile.picture}}" style="
width: 48px;
margin: 2px;
border-radius: 48px;
border: 0px solid #ddd;">
只需手動重新加載頁面,上面的代碼將被執行,並且所有的都將按預期更新。
可以使用您的注入權威性的服務,並顯示正確的元素基於身份驗證 – charlietfl