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;
       }
    });
  • 相关阅读:
    java项目中文件含义
    关于反射技术
    Subversion Edge部署
    svn Edge访问规则配置
    redhat开启端口
    关于Ant脚本
    Maven
    版本控制工具
    Oracle了解(一)
    java 空格替换%20
  • 原文地址:https://www.cnblogs.com/beng/p/3833080.html
Copyright © 2011-2022 走看看