Skip to content

Commit 74a182a

Browse files
authored
Create README.md
1 parent b8e8396 commit 74a182a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,7 @@ app.controller('pageMain2Ctrl', function($scope, $state) {
11751175
})
11761176
```
11771177
**ng路由**
1178+
11781179
1.加载ng路由模块,引入angular.js之后
11791180
11801181
```html
@@ -1195,15 +1196,17 @@ angular.module('helloWscatsApp',['ngRoute'])
11951196
**$routeProvider**
11961197
11971198
两个核心方法`when()``otherwise()`
1199+
11981200
|配置参数|用法|
1199-
|-|-|
1201+
| - | - |
12001202
|controller|function或string类型。在当前模板上执行的controller函数,生成新的scope|
12011203
|controllerAs|string类型,为controller指定别名|
12021204
|template|string或function类型,视图所用的模板,这部分内容将被ngView引用|
12031205
|templateUrl|string或function类型,当视图模板为单独的html文件或是使用了`<script type="text/ng-template">`定义模板时使用|
12041206
|resolve|指定当前controller所依赖的其他模块|
12051207
|redirectTo|重定向的地址|
12061208
1209+
12071210
可以使用`$routeProvider`用来定义路由规则
12081211
```javascript
12091212
module.config(['$routeProvider', function($routeProvider) {

0 commit comments

Comments
 (0)