随笔分类 - AngularJS
摘要:AngularJS 的四个核心思想 1、依赖注入 注:所谓依赖注入,是指程序运行过程中,如果需要调用另一个对象协助时,无须在代码中创建被调用者,而是依赖于外部的注入。 依赖注入(Dependency Injection)和控制反转(Inversion of Control)是同一个概念。具
        阅读全文
                
摘要:简介 过滤器可以使用一个管道字符(|)添加到表达式和指令中。 AngularJS 过滤器可用于转换数据: 代码 以currency 过滤器为例: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script type="text/javas
        阅读全文
                
摘要:1、ng-app 决定了angularjs的作用域范围,你可以如下使用: 来让angularjs渲染整个页面,也可以使用 来渲染其中的一部分。 2、ng-model ng-model,当你的数据模型被改变的时候,譬如ng-model='test',其中这个test的数值被改变的时候,{{test}}
        阅读全文
                
摘要:AngularJS 中你可以创建自己的服务,或使用内建服务。 什么是服务? 在 AngularJS 中,服务是一个函数或对象,可在你的 AngularJS 应用中使用。 AngularJS 内建了30 多个服务。 $location 服务 有个 $location 服务,它可以返回当前页面的 URL
        阅读全文
                
摘要:代码 #未引入MVC框架之前的代码 <!doctype html> <html> <head> <meta charset="UTF-8"> <title>AngualrJS进阶</title> <link rel="stylesheet" type="text/css" href="css/fou
        阅读全文
                
摘要:代码 #方法一:ng-bind的使用 #方法二:{{}}插值表达式的使用 <!doctype html> <html> <head> <meta charset="UTF-8"> <title>AngualrJS进阶</title> <link rel="stylesheet" type="text
        阅读全文
                
摘要:代码 angularjs.html <!doctype html> <html> <head> <meta charset="UTF-8"> <title>AngualrJS进阶</title> <link rel="stylesheet" type="text/css" href="css/fou
        阅读全文
                
摘要:代码: myctrl.js angular.module('app',[]) .controller('MyCtrl',function($scope){ $scope.msg=""; $scope.reverse=function(){ return $scope.msg.split("").re
        阅读全文
                
 
                    
                
 浙公网安备 33010602011771号
浙公网安备 33010602011771号