angular的location服务的使用

来源:互联网 发布:在数据库表中设置null 编辑:程序博客网 时间:2024/05/21 15:04


<!DOCTYPE html><html><head><meta charset="UTF-8"><title>http的使用</title><script src="day2/src/angular.js"></script><style type="text/css"></style></head><body><div ng-app="fristApp"><div ng-controller="fristController"></div></div></body><script type="text/javascript">var myApp = angular.module('fristApp',[]);myApp.config(function(){})// location 可以操作地址栏 absUrl()可以获取完整的地地址//myApp.controller('fristController',function($scope,$location){console.log($location.absUrl())// 可以读写##后面地址  ##test//$location.hash('test')//console.log($location.hash())// #/test//$location.path('test')//console.log($location.path());//console.log($location.port());//console.log($location.protocol());// 刷新页面//$window.location.href = });myApp.controller('secondController',function($scope){console.log("fuji")})</script></html>


0 0
原创粉丝点击