[AngularJS] New in Angular 1.3 - bindToController
If you want to use controllers, instead of a link function, you can use bindToController.
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>Egghead.io Tutorials</title>
<style>body{padding:20px}</style>
<link rel="shortcut icon" href="favicon.ico">
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.3/angular.js"></script>
<script src="app.js"></script>
</head>
<body> <note message="hello"></note>
</body>
</html>
angular.module("app", []) .directive("note", function note() {
return {
scope: {
message: "@" //pass in a string
},
bindToController: true,
controller: "NoteCtrl as note",
template: "<div>{{note.message}}</div>"
};
}) .controller("NoteCtrl", function NoteCtrl() {
var note = this;
});
[AngularJS] New in Angular 1.3 - bindToController的更多相关文章
- [Angular] Use Angular components in AngularJS applications with Angular Elements
When migrating AngularJS (v1.x) applications to Angular you have different options. Using Angular El ...
- 【js类库AngularJs】解决angular+springmvc的post提交问题
[js类库AngularJs]解决angular+springmvc的post提交问题 AngularJS诞生于2009年,由Misko Hevery 等人创建,后为Google所收购.是一款优秀的前 ...
- [AngularJS] New in Angular 1.3 - Performance Boost with debugInfoEnabled
By default, Angular provides a lot of debug information on the DOM that's only necessary for tools l ...
- [AngularJS] Lazy loading Angular modules with ocLazyLoad
With the ocLazyLoad you can load AngularJS modules on demand. This is very handy for runtime loading ...
- [AngularJS - thoughtram] Exploring Angular 1.3: Binding to Directive Controllers
The post we have: http://www.cnblogs.com/Answer1215/p/4185504.html gives a breif introduce about bin ...
- [AngularJS] Exploring the Angular 1.5 .component() method
Angualr 1.4: .directive('counter', function counter() { return { scope: {}, restrict: 'EA', transclu ...
- [AngularJS] New in Angular 1.5 ng-animate-swap
<!DOCTYPE html> <html ng-app="MyApplication"> <head> <link rel=" ...
- AngularJS进阶(五)Angular实现下拉菜单多选
Angular实现下拉菜单多选 写这篇文章时,引用文章地址如下: http://ngmodules.org/modules/angularjs-dropdown-multiselect http:// ...
- AngularJS进阶(四)ANGULAR.JS实现下拉菜单单选
ANGULAR.JS: NG-SELECT AND NG-OPTIONS PS:其实看英文文档比看中文文档更容易理解,前提是你的英语基础还可以.英文文档对于知识点讲述简明扼要,通俗易懂,而有些中文文档 ...
随机推荐
- util-判断当前年份所处的季度,并返回当前季度开始的月份
ylbtech-funcation-util: 判断当前年份所处的季度,并返回当前季度开始的月份 判断当前年份所处的季度,并返回当前季度开始的月份. 1.A,Ylbtech.Model返回顶部 us ...
- (原创)LAMP教程3-下载centos6.4
(原创)LAMP教程3-下载centos6.4 今天我要给大家讲的是安装CentOS-6.4-x86_64,是的没有错,就是64位的,因为我的机子是4G的内存,安装64位的centos是绰绰有余啊,但 ...
- 【windows核心编程】DLL相关(3)
DLL重定向 因为DLL的搜索路径有先后次序,假设有这样的场景:App1.exe使用MyDll1.0.dll, App2.exe使用MyDll2.0.dll, MyDll1.0 和 MyDll2.0是 ...
- 通过gdb跟踪进程调度分析进程切换的过程
作者:吴乐 山东师范大学 <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 本实验目的:通过gdb在lin ...
- [原创]从Confluence获取html table并将其序列化为C#类文件的工具
公司项目的游戏数据模型文档写在Confluence上,由于在项目初期模型变动比较频繁,手工去将文档中最新的模型结构同步到代码中比较费时费力,而且还很容易出错,于是写了一个小工具来自动化这个同步更新模型 ...
- Hadoop上路-03_Hadoop JavaAPI
一.Eclipse安装 1.下载解压 下载:http://www.eclipse.org/downloads/ 解压:SHELL$ sudo tar -zxvf eclipse.tar.gz 2.快捷 ...
- 使用DBCC SHOW_STATISTICS展示索引的统计信息
在开始之前搭建演示环境: USE master GO SET NOCOUNT ON --创建表结构 IF OBJECT_ID(N'ClassA', N'U') IS NOT NULL DROP TAB ...
- Windows Server 2012 四个版本对比
Windows Server 2012 有4种版本: Foundation, Essentials, Standard and Datacenter. 版本 Foundation Essentials ...
- Codeforces 372
A (被装的袋鼠不可以装的袋鼠)贪心,排序,从n/2分成两部分. B 好一道前缀和的题目. C 标准算法不难想,m^2的算法见http://codeforces.com/blog/entry/9907 ...
- Emacs Lisp 功能扩展集锦
http://docs.huihoo.com/homepage/shredderyin/emacs_elisp.html Emacs 具有超强的扩展性.这是当今没有任何其它编辑器可以比拟 的强大特点. ...