![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
angularJs
CallMeKongkong
简简单单、清清楚楚、明明白白、轻轻松松
展开
-
angularJs自定义指令用到的属性和方法
.directive('myDirective', function() {return {restrict: String,priority: Number,terminal: Boolean,template: String or Template Function:function(tElement, tAttrs) (...},templateUrl: Stri原创 2015-10-09 10:16:40 · 571 阅读 · 0 评论 -
$emit/$broadcast/$on用法
$emit只能向parent controller传递event与data$broadcast只能向child controller传递event与data$on用于接收event与data原创 2015-10-10 16:15:17 · 1381 阅读 · 0 评论 -
angular模块加载
1.配置在模块的加载阶段,AngularJS会在提供者注册和配置的过程中对模块进行配置。需要特别注意,AngularJS会以这些函数书写和注册的顺序来执行它们。当对模块进行配置时,需要格外注意只有少数几种类型的对象可以被注入到config()函数中:提供者和常量。angular.module('myApp', []).config(function($provide) {原创 2015-10-28 14:32:08 · 535 阅读 · 0 评论 -
angularJs中factory,service,provider
service是一个构造器可作为通信或者共享数据都很合适。factory是一个方法。provider是一个可配置的factory。(可用config()配置)原创 2015-10-16 09:13:54 · 482 阅读 · 0 评论 -
angular自定义服务
共有5种方法用来创建服务:factory(name,getFn):函数可以接受两个参数。name(字符串)需要注册的服务名。getFn(函数),暴露服务。angular.module('myApp').factory('myService', function() { return { 'username': '原创 2015-10-28 14:53:36 · 1277 阅读 · 0 评论