2014-10-28 46 views
0

現在我在路由文件中有這段代碼。在Angularjs UI-Router中,如何檢查URL的條件?

$stateProvider. 
state('home', { 
    url: '/', 
    templateUrl: 'modules/core/views/home.client.view.html' 
}). 
state('thread', { 
    url: '/:thread_id', 
    templateUrl: 'modules/core/views/thread.client.view.html' 
}). 
state('privacy', { 
    url: '/privacy', 
    templateUrl: 'modules/core/views/privacy.client.view.html' 
}). 
state('terms', { 
    url: '/privacy', 
    templateUrl: 'modules/core/views/terms.client.view.html' 
}); 

我的目標是:當thread_id是純整數,它定位到thread.client.view.html。否則,它導航到其他頁面,如隱私,條款等

是否有可能實現這一目標?

回答