1.定义

  1. var m = angular.module('ddd',[]);
  2. m.controller('ctrl',['$scope',function ($scope) {
  3. }]);

2.外部调用

  1. angular.element('[ng-controller=ctrl]').scope().data = json.data;
  2. angular.element('[ng-controller=ctrl]').scope().$apply();

随机推荐

  1. cookie,session,viewstate

    viewstate的原理是隐藏域. protected void Page_Load(object sender, EventArgs e) { ViewState["v1"] = ...

  2. C# How to convert MessageBodyStream to MemoryStream?

    通过WCF服务从数据库取文档数据时,返回的是Stream对象,在DevExpress的PDFViewer显示时,用PDFViewer.LoadDocunent(Stream stream);方法时,报 ...

  3. C# WinForm的练习

    今天写了一个WinForm的练习,将源代码贴出来和大家一起学习学习. 首先:按照下图将一个button控件.三个RadioButton控件.三个CheckBox控件.一个Label控件和一个Track ...

  4. [Offer收割]编程练习赛37

    热门号码 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<vector> ...

  5. MySQL 5.6 Reference Manual-14.7 InnoDB Table Compression

    14.7 InnoDB Table Compression 14.7.1 Overview of Table Compression 14.7.2 Enabling Compression for a ...

  6. Spring AOP理解

    Spring的核心思想的IOC和AOP.最近学习AOP,对切面的学习有了进一步的认识. Spring用代理类包裹切面,把他们织入到Spring管理的bean中.也就是说代理类伪装成目标类,它会截取对目 ...

  7. [翻译]内存一致性模型 --- memory consistency model

    I will just give the analogy with which I understand memory consistency models (or memory models, fo ...

  8. ubuntu下svn up 出现 Can't convert string from 'UTF-8' to native encoding

    root@ubuntu:/data/www# svn up svn: warning: cannot set LC_CTYPE locale svn: warning: environment var ...

  9. 高级I/O函数

    给套接口上的I/O设置超时 1.调用alarm,在调用超过指定时间时产生SIGALARM信号,这涉及到信号处理,而且可能和进程中其他的alarm冲突 2.使用select阻塞在等待I/O上,selec ...

  10. jquery获取元素内容-text()和val()

    不传参数的text()方法在获取文本内容时,会把子元素的文本也获取过来(会删除 HTML 标记),例子: <!doctype html> <html> <head> ...