angular.js - How to pass empty string in angularJs ngRoute route and obtain it using ng-switch
phpcn_u1582
phpcn_u1582 2017-05-15 17:08:43
0
2
617
  .when('/asset/:type', {//资产详情路由
                templateUrl: 'tpl/asset.html',
                controller: 'assetCtrl'
            })

One of the types in the routing config may be a null value. Different values ​​jump to pages with inconsistent display effects. Now use the function on the page:
ng-click="jump('/asset/ ' )" can pass an empty string, but the corresponding route after jumping to the page is: #/asset/ , with automatically added at the end, and then use ng-switch-when in ng-switch="type" =" ", but the corresponding effect cannot be displayed. I also tried ng-switch-when=" ", but failed to jump to the matching style. How can I achieve this effect?

phpcn_u1582
phpcn_u1582

reply all(2)
phpcn_u1582

It is empty by default, no need to add a space character to achieve it

阿神

$locationProvider.hashPrefix('');

This is caused by the new version of ngroute adding an exclamation mark. Just get rid of him

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template