文章詳情頁
angular.js - 關(guān)于ui-sref地址欄缺省的問題
瀏覽:309日期:2024-09-24 11:03:47
問題描述
我自己在看大漠老師的一個angular的bookstore的小例子,在做到ui-sref的時候發(fā)現(xiàn)了一個問題
<a ui-sref='booklist({bookType:0})' class='list-group-item'>計算機(jī)</a>
此時地址欄顯示的是這樣的 http://localhost:8080/#/0而另外一行代碼
<a ui-sref='bookdetail({bookId:row.getProperty(col.field)})' id='{{row.getProperty(col.field)}}'>詳情</a>
顯示卻是這樣的 http://localhost:8080/#/bookd...
所以我的問題是為什么上面那行的ui-sref中的booklist在地址欄里省略了 而details卻可以
我查了一些ui-router的官方文檔 關(guān)于$state.href方法例子如下:expect($state.href('about.person', { person: 'bob' })).toEqual('/about/bob');
問題解答
回答1:
路由url配置問題
你這樣寫 第一種就有了
上一條:angular.js - karma測試包JASMINE is not defined下一條:angular.js - angular ng-model中輸入中文不更新,再添加數(shù)字、字母或空格,就可以綁定了
相關(guān)文章:
1. boot2docker無法啟動2. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””3. docker-compose中volumes的問題4. javascript - mock.js可以存儲數(shù)據(jù)嗎5. nignx - docker內(nèi)nginx 80端口被占用6. java - SSH框架中寫分頁時service層中不能注入分頁類7. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.8. dockerfile - 為什么docker容器啟動不了?9. golang - 用IDE看docker源碼時的小問題10.排行榜boot2docker無法啟動 1. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities”” 2. docker-compose中volumes的問題 3. docker安裝后出現(xiàn)Cannot connect to the Docker daemon. 4. javascript - mock.js可以存儲數(shù)據(jù)嗎 5. nignx - docker內(nèi)nginx 80端口被占用 6. java - SSH框架中寫分頁時service層中不能注入分頁類 7. node.js - antdesign怎么集合react-redux對input控件進(jìn)行初始化賦值 8. 關(guān)于docker下的nginx壓力測試 9. docker容器呢SSH為什么連不通呢? 10. 熱門標(biāo)簽

網(wǎng)公網(wǎng)安備