Open zhengwei1949 opened 6 years ago
<script src="?">
cnpm install
var gulp = require('gulp');//引入gulp库 var uglify = require('gulp-uglify');//因为我们下面要压缩js,所以,这里面引入gulp-uglify插件 gulp.task('ceshi',function(){//创建一个任务,名字叫ceshi gulp.src('./a.js')//指定我们要处理什么文件 .pipe(uglify())//使用uglify插件 .pipe(gulp.dest('./dist'));//指定我们要处理的文件处理好之后放到哪里 })
+ mvvm和mvc的区别 1. mvc : 不管什么操作要通过控制器 2. mvvm: 视图和$scope上的数据是双向数据绑定的,并不需要经过什么控制器
1. 参考https://github.com/zhengwei1949/module
var myApp = angular.module('myApp',[]); myApp.controller('myController',function($scope){ })
function myController($scope){ }
var myApp = angular.module('myApp',[]); myApp.controller('myController',function(){ this.name = 'xiao ming'; })
var myApp = angular.module('myApp',[]); myApp.controller('myController',['$scope',function($scope){ }])
<li ng-repeat="item in data | filter : true"> {{item.name}} </li>
+ 精确匹配
<li ng-repeat="item in data | filter : {completed:true}"> {{item.name}} </li>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body ng-app="myApp" ng-controller="myController"> <input type="text" ng-model="A">+ <input type="text" ng-model="B"> <input type="button" value="=" ng-click="add()"> <input type="text" ng-model="result"> <script src="./angular.js"></script> <script> var myApp = angular.module('myApp',[]) myApp.controller('myController',function($scope){ $scope.A = 0; $scope.B = 0; $scope.add = function(){ $scope.result = ($scope.A - 0) + ($scope.B - 0); } }) </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body ng-app="myApp" ng-controller="myController"> <input type="text" ng-model="A">+ <input type="text" ng-model="B"> <p>{{(A-0) + (B-0)}}</p> <script src="./angular.js"></script> <script> var myApp = angular.module('myApp',[]) myApp.controller('myController',function($scope){ $scope.A = 0; $scope.B = 0; }) </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body ng-app="myApp" ng-controller="myController"> <input type="text" ng-model="A">+ <input type="text" ng-model="B"> <p ng-bind="(A-0) + (B-0)"></p> <script src="./angular.js"></script> <script> var myApp = angular.module('myApp',[]) myApp.controller('myController',function($scope){ $scope.A = 0; $scope.B = 0; }) </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body ng-app="myApp" ng-controller="myController"> <input type="text" ng-model="A">+ <input type="text" ng-model="B"> <p ng-bind="getResult()"></p> <script src="./angular.js"></script> <script> var myApp = angular.module('myApp',[]) myApp.controller('myController',function($scope){ $scope.A = 0; $scope.B = 0; $scope.getResult = function(){ return ($scope.A - 0) + ($scope.B - 0); } }) </script> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </head> <body ng-app="myApp" ng-controller="myController"> <input type="text" ng-model="A">+ <input type="text" ng-model="B"> <p>{{getResult()}}</p> <script src="./angular.js"></script> <script> var myApp = angular.module('myApp',[]) myApp.controller('myController',function($scope){ $scope.A = 0; $scope.B = 0; $scope.getResult = function(){ return ($scope.A - 0) + ($scope.B - 0); } }) </script> </body> </html>
myApp.server('myService',[function(){ this.name = 'itcast'; }]); myApp.controller('myController',['$scope','myService',function($scope,myService){ console.log(myService.name); }])
项目初始化
``git clone https://github.com/tastejs/todomvc-app-template.git
展示任务
添加任务
删除任务
修改任务内容
切换任务状态
批量切换任务状态
显示未完成的任务数
清除所有已完成任务
为什么要从后往前删的理解
//思考:为什么不能把6删除掉?????? var arr = [1,4,6,9]; for(var i=0;i<arr.length;i++){ if(arr[i]%2 === 0){ arr.splice(i,1); } } console.log(arr);
filter过滤器实现切换不同状态任务的显示
切换不同状态焦点状态样式的操作
使用$watch重构all,active,completed这块的代码
使用service进行重构代码(这块了解即可)
流行框架课程重难点总复习
tips
git
为什么要学习git
概念
git操作流程
常用命令
tips
npm
为什么要学习npm
概念
<script src="?">
cnpm install
下载下来所有的node_modules里面的代码常用命令
gulp
为什么要学习gulp
常见api
常见插件
代码示例参考
angular
为什么要学习angular
angular理解
书写angular.js代码的步骤
对mvc的理解
对mvvm的理解
对模块化的理解
常见内置指令
创建控制器的四种方式
自定义指令常见属性
过滤器
实现计算器的N种思路
监视$watch
服务(service)
todoMVC思路
前期训练
思维模式
书写代码步骤及思路
项目初始化
``git clone https://github.com/tastejs/todomvc-app-template.git
展示任务
添加任务
删除任务
修改任务内容
切换任务状态
批量切换任务状态
显示未完成的任务数
清除所有已完成任务
为什么要从后往前删的理解
filter过滤器实现切换不同状态任务的显示
切换不同状态焦点状态样式的操作
使用$watch重构all,active,completed这块的代码
使用service进行重构代码(这块了解即可)
路由
豆瓣项目思路
考试注意事项