Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

angular1中$route和$routeParams和$location的区别?

angular1中$route和$routeParams和$location的区别?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

$route能够在路径发生改变的时候,渲染不同的视图,调用不同的控制器
$routeParams可以获取当前路径参数,路径参数是$location.search()和$location.path()的组合,当$route被匹配的时候,路径参数就会被获取
$location服务的主要作用是用于获取当前url以及改变当前的url


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...