我正在使用角度路由在我的應用中更改視圖。當改變視圖時(用戶點擊一個鏈接),新的視圖被添加在底部,舊的視圖在那裏停留約1秒鐘,然後消失。更改視圖slowjs
當聽$ routeChangeStart/success和$ viewContentLoaded時,我可以看到新視圖實際加載得非常快,只是舊視圖不夠快速隱藏。
任何想法?
的Html
<div class="content container-fluid" ng-view id="main"></div>
代碼
config(['$routeProvider', function ($routeProvider) {
$routeProvider.when('/dashboard:l3_outputmaterial_id?', { templateUrl: 'app/frontend/inline/dashboard.html', controller: 'dashboardCtrl' });
$routeProvider.when('/nicetohave', { templateUrl: 'app/frontend/nice/nicetohave.html', controller: 'niceToHaveCtrl' });
$routeProvider.when('/login/:return_url', { templateUrl: 'app/frontend/auth/login.html', controller: 'loginCtrl' });
}])
分享你到哪兒去納克視角,也是你的聽衆代碼 – mohamedrias 2015-04-03 13:55:14
NG-動畫做到這一點,檢查答案在這裏你的html代碼: http://stackoverflow.com/questions/28120025/angularjs-nghide-delayed -with-ngshow/28120157#28120157 – Ins 2015-04-03 14:52:36
@Ins謝謝,答案奏效。奇怪的是,因爲當我一起刪除ngaminate時,延遲仍然存在。 – 2015-04-07 07:21:57