【发布时间】:2017-07-24 21:45:53
【问题描述】:
我有一行简单的代码,可以使用 AngularJS 获取当前路径位置:
$location.path()
结果为以下格式:/stringValue/intValue/stringValue 例如 - test/1234/testing
从 $location.path() 返回的内容中提取intValue 的最简单方法是什么?
【问题讨论】:
-
$location.path().split('/')[1]呢?
标签: javascript angularjs