[Angularjs]视图和路由(三)
发布时间:2020-12-17 10:36:03 所属栏目:安全 来源:网络整理
导读:写在前面 系列文章 $routeParams 一个例子 '/user/:name' 'UserController' 'views/user.html' {name:'wolfy'} app.controller('UserController', $location服务 path() $location.path(); $location.path('/'); replace() $location.path('/home' $location
写在前面
系列文章
$routeParams
一个例子 '/user/:name''UserController''views/user.html'
{name:'wolfy'}
app.controller('UserController',
$location服务
path() $location.path();
$location.path('/');
replace()
$location.path('/home'$location.replace();
<span style="color: #008000;">//<span style="color: #008000;">或者
<span style="color: #000000;"> $loaction.path('/home').replace(); absUrl()
$location.absUrl();
hash()
$location.hash();
host()
$location.host();
port()
$location.port();
protocol()
$location.protocol();
search()
$location.search();
$location.search({name:'wolfy',userName:'wolfy sun'
$location.search('name=wolfy&username=wolfy sun');
一个例子
url = http:
$location.search()['name'];
url()
$location.url();
$location.url('/home?name=wolry#hashthing');
?总结
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- linux crontab 实现每秒执行的实例
- AngularJS:禁用或删除生成的HTML中的ng-scope和ng-binding
- angular – 使用hasError()进行验证的表单生成器抛出错误ER
- 使用bash脚本更改MySQL root密码
- 使用Angular与TypeScript构建Electron应用(四)
- bootstrap3 modal加载远程页面缓存问题
- twitter-bootstrap – Jquery Select2 -Chain select – Ho
- 如果我有一个AngularJS背景,javascript – “ReactJS中的思
- angularjs – Angular UI / select2多个如何预选值/选项?
- shell – 如何获取XCode以将Info日期和时间添加到Info.plis