1.0.2 • Published 7 years ago

angular-day02 v1.0.2

Weekly downloads
84
License
ISC
Repository
-
Last release
7 years ago

5w1h:干什么,怎么用,什么时候用,

angular与jQuery的关系

  • jqLite angular.element(DOM对象)
  • 假如在我们的angular库引入之前引入了jquery库,jQLite === jQuery --> angular.element('#demo')

angular中的MVVM架构图

  • view
  • controller
  • view model($scope)
  • model

划分模块的方式

  • 按功能划分
  • 按文件划分 按MVC来划分 controller,model -->

写控制器的三种方式

  • 面向对象 $scope.name this.name
  • 传统方式
  • 使用面向对象的方式
  • 安全的方式 --> ng-angular-annotate myApp.controller('myController','$scope','$log',function(a,b))

依赖注入的原理

Dependence Inject DI

指令

  • ng-app
  • ng-click
  • ng-model
  • ng-init
  • ng-controller
  • ng-cloak --> class='ng-cloak'
  • ng-class
  • ng-style
  • ng-repeat
  • ng-show,ng-hide
  • ng-if
  • ng-switch,ng-switch-when