标签属性介绍

ng-class="{className:expression}" 如果expression为true,则使用className这个class。

ng-click="functionName(pram)" 这跟onclick是一样的,点击就执行functionName(pram)。

ng-repeat="i in set | filter:filterExpression or filterFunction| orderBy:order+orderType" 循环set里的元素,有过滤条件和排序条件。

    
    
    
    body {        font-family: "Arial", "Microsoft YaHei", "黑体", "宋体", sans-serif;    }        .orderColor {        color: red;    }    
    
        
            
                
                
                    
                        
                            
                                                                                        
                                                
产品名称
                    
产品编号
                    
产品价格
                                                        
                    `item`.`id`                    `item`.`name`                    { {item.price | currency:'RMB '}}                                            
    
    angular.module('product', [])        .service('productData', function() {            return [{                id: 1098,                name: 'iPhone',                price: 5288            }, {                id: 5420,                name: 'iPad',                price: 4388            }, {                id: 2067,                name: 'Mac Book',                price: 10888            }, {                id: 5991,                name: 'Surface',                price: 9288            }];        })        .controller('firstController', function($scope, productData) {            $scope.productData = productData;            $scope.orderType = 'id';            $scope.order = '-';            $scope.changeOrder = function(type) {                $scope.orderType = type;                if ($scope.order === '') {                    $scope.order = '-';                } else {                    $scope.order = '';                }            }        });