zoukankan      html  css  js  c++  java
  • angular

    1、样式相关指令

    ng-class 用来给元素绑定类名

    1)类名字符串,可以用空格分割多个类名

    2)类名数组,数组中的每一项都会层叠起来生效

    3)键值为类名,值为boolean类型,当值为true时,该类会被加在元素上。

    ng-style用来帮顶元素的css样式

    ng-show,ng-hide 对元素显示隐藏的控制

    2、表单控件相关指令

    ng-checked控制radio和checkbox的选中状态

    ng-selected控制下拉框的选中状态

    ng-disabled控制失效状态

    ng-multiple控制多选

    ng-readonly控制只读状态

    3、事件绑定相关指令

    ng-click

    ng-change

    ng-mousedown

    ng-mouseenter

    ng-mouseleave

    ng-mousemove

    ng-mouseover

    ng-mouseup

    ng-submit

    二、service

    1、factory

    app.controller('myApp',function($scope,myFactory){
      $scope.artist=myFactory.getArtist();  
    }
    app.factory('myFactory',function(){
        var _artist='';
        var service={};
        service.getArtist=function(){
            return _artist;
        }
         return service;
    });

    2、service

    app.controller('myApp',function($scope,myService){
       $scope.artist=myService.getArtist();
    }
    app.service('myApp',function(){
       var _artist='hello';
       this.getArtist=function(){
            return _artist;
       }
    });
  • 相关阅读:
    POJ 3279 Fliptile 枚举+搜索
    POJ 3278 Catch That Cow
    CS Academy Round41 BFS+DFS
    CS Academy Round41 Tennis Tournament
    CS Academy Round41 Cinema Seats
    POJ 1177 Picture
    HDU 1255 覆盖的面积
    POJ 1151 Atlantis 线段树+离散化
    HDU 4614 Vases and Flowers 线段树+二分
    凑数问题
  • 原文地址:https://www.cnblogs.com/beng/p/3833080.html
Copyright © 2011-2022 走看看