Angular路由
来源:互联网 发布:淘宝店铺必须有网银吗 编辑:程序博客网 时间:2024/05/21 06:58
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
ul {
list-style: none;
}
ul li {
float: left;
width: 60px;
}
a {
text-decoration: none;
}
</style>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/angular-route.js" ></script>
</head>
<body ng-app="MyApp" ng-app="MyCont">
<ul>
<li>
<a href="#/">主页</a>
</li>
<li>
<a href="#/bb">购物车</a>
</li>
<li>
<a href="#/cc">我的</a>
</li>
</ul>
<div ng-view style="background-color: gray;">
</div>
<script>
var mo = angular.module("MyApp", ["ngRoute"]);
mo.controller("MyCont", function($scope) {
})
mo.config(function($routeProvider) {
// $routeProvider.when("/aa", {
// templateUrl: "zhuye.html"
// });
//
// $routeProvider.when("/bb", {
// templateUrl: "goods.html"
// })
//
// $routeProvider.when("/cc", {
// templateUrl: "me.html"
// })
$routeProvider.when("/",{template:"我是主页"}).when("/bb",{templateUrl:"goods.html"}).when("/cc",{templateUrl:"me.html"});
})
</script>
</body>
</html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
ul {
list-style: none;
}
ul li {
float: left;
width: 60px;
}
a {
text-decoration: none;
}
</style>
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript" src="js/angular-route.js" ></script>
</head>
<body ng-app="MyApp" ng-app="MyCont">
<ul>
<li>
<a href="#/">主页</a>
</li>
<li>
<a href="#/bb">购物车</a>
</li>
<li>
<a href="#/cc">我的</a>
</li>
</ul>
<div ng-view style="background-color: gray;">
</div>
<script>
var mo = angular.module("MyApp", ["ngRoute"]);
mo.controller("MyCont", function($scope) {
})
mo.config(function($routeProvider) {
// $routeProvider.when("/aa", {
// templateUrl: "zhuye.html"
// });
//
// $routeProvider.when("/bb", {
// templateUrl: "goods.html"
// })
//
// $routeProvider.when("/cc", {
// templateUrl: "me.html"
// })
$routeProvider.when("/",{template:"我是主页"}).when("/bb",{templateUrl:"goods.html"}).when("/cc",{templateUrl:"me.html"});
})
</script>
</body>
</html>
阅读全文
0 0
- angular 路由
- angular路由
- Angular路由
- angular 路由
- Angular路由
- angular路由
- angular路由
- angular路由
- Angular路由
- angular路由
- angular 路由
- Angular路由
- Angular 路由
- Angular路由
- angular 路由
- angular路由
- angular之路由,模板
- Angular路由2
- 非常简单的java通过poi创建excle表格
- 1013. 数素数 (20)
- Firefox内存占用过高解决方法
- 设置mysql允许远程连接
- 游戏编程模式(Game Programming Patterns)的 C#&Unity 练习一:命令模式
- Angular路由
- 图片上传
- 本地代码关联到远程仓库
- 深入分析C++中char * 和char []的区别
- MVC全局登录验证——Action全局过滤器
- Protocol Buffer序列化对比Java序列化.
- 做程序员压力山大,很多人都快疯了
- 数据结构第十章 排序 总结
- Hystrix 源码解析 —— 执行命令方式