2014-03-13 42 views
0

我已經有了一個jQuery版本的應用程序。它是SPA(單頁應用程序)ajax應用程序。有一個要求:URL永遠不會改變。

我嘗試使用Angular編寫同一個應用程序,使用$ routeProvider導致URL被更改。我希望Angular版本的應用在模板更改時不會更改URL。任何幫助表示讚賞....

回答

0

這是可能與使用ng-include指令:

<a href="#" ng-click="template='views/list.html'">List</a> 
<a href="#" ng-click="template='views/add.html'">Add</a> 
<a href="#" ng-click="template='views/edit.html'">Edit</a> 
<a href="#" ng-click="template='views/view.html'">View</a> 

<ng-include src="template"/> 

對於工作示例,請看一看這個JSFiddle

+0

它適合你嗎? – PrimosK