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;
       }
    });
  • 相关阅读:
    模块-- HASH
    模块 –SYS
    所谓情商高,就是要有分寸感
    20个很有用的CSS技巧
    CSS3中文手册基础知识
    赠书《JavaScript高级程序设计(第三版)》5本
    能走多远,取决于你与谁同行
    谷歌网站
    开发头条精选0724
    开发头条精选0723
  • 原文地址:https://www.cnblogs.com/beng/p/3833080.html
Copyright © 2011-2022 走看看