# 2016年3月19日

## angularjs

* $scope
  * $scope.$watch
    * 监听程序变化
  * $scope.$apply
    * 监听数据变化，数据变化，会影响视图。
* angular.module
  * controller
  * run
* angularJs的过滤器
  * currency
  * number
  * lowercase/uppercase
  * json
  * limitTo
  * date
  * orderBy
  * filter

```javascript
//过滤器组合使用
m1.controller('Aaa',['$scope','$filter',function($scope,$filter){

    //$scope.name = '723894734.7489545';
    //$scope.name = 'hello';
    //$scope.name = {"name":"hello","age":"20"};
    //$scope.name = ['a','b','c'];
    $scope.name = '3748935795';

    /*$scope.name = [
        {color:"red",age:"20"},
        {color:"yellow",age:"30"},
        {color:"blue",age:"40"},
        {color:"green",age:"10"}
    ];*/

    //$scope.name = $filter('uppercase')('hello');
    //$scope.name = $filter('number')('236478234.3647348',1);
    //$scope.name = $filter('date')('236478234','hh');

    //$scope.name = 'hello';

    $scope.name = $filter('firstUpper')('hello');


}]);


//自定义过滤器
//

m1.filter('firstUpper',function(){
    return function(str,num){
        //console.log(num);
        return str.charAt(0).toUpperCase() + str.substring(1);
    }
});
```

* ng-repeat
* ng-app
  * 初始化angularjs这个库的指令
* ng-controller
  * 调用控制器，把数据与视图连接在一起
* ng-model

  &#x20; \+&#x20;
* ng-click
  * 点击事件


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://note.niefee.com/summary/3/2016-nian-3-yue-19-ri.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
