angularjs-$location 服务

前端之家收集整理的这篇文章主要介绍了angularjs-$location 服务前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<!DOCTYPE html>@H_404_1@

<html>@H_404_1@

<head>@H_404_1@

<Meta charset="utf-8">@H_404_1@

<Meta http-equiv="X-UA-Compatible" content="IE=edge">@H_404_1@

<title></title>@H_404_1@

<link rel="stylesheet" href="">@H_404_1@

</head>@H_404_1@

<body>@H_404_1@

<div ng-app="myApp" ng-controller="myCtrl">@H_404_1@

<p>当前页面的url:</p>@H_404_1@

<h3>{{myUrl}}</h3>@H_404_1@

</div>@H_404_1@

</body>@H_404_1@

<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>@H_404_1@

<script>@H_404_1@

var app = angular.module("myApp",[]);@H_404_1@

app.controller("myCtrl",function($scope,$location){@H_404_1@

$scope.myUrl = $location.absUrl();@H_404_1@

});@H_404_1@

</script>@H_404_1@

</html>@H_404_1@ 原文链接:https://www.f2er.com/angularjs/148186.html

猜你在找的Angularjs相关文章