为什么这个angularjs例子对plunker不起作用?

在这个有角度的文件http://docs.angularjs.org/guide/concepts中,有一个关于指令的例子.

Directives

A directive is a behavior or DOM transformation which is triggered by the presence of a custom attribute,element name,or a class name. A directive allows you to extend the HTML vocabulary in a declarative fashion. Following is an example which enables data-binding for the contenteditable in HTML.

它提供了两个现场演示,一个用于plunker,另一个用于jsfiddle.

> plunker:http://plnkr.co/edit/nsAUafYFA1tHPo52TWUm?p=preview
> jsfiddlehttp://jsfiddle.net/rnL84/

为什么jsfiddle运行良好,但是一个不起作用?它们具有完全相同的代码,并且控制台中没有错误.

plunker在index.html中使用ng-app而不是ng-app =’directive’.

需要在ng-app中指定script.js javascript文件中定义的模块(在此示例中为named指令),以便它获取contenteditable指令:

angular.module(‘directive’,[])…

有关工作版本,请参阅this plunker.

相关文章

ANGULAR.JS:NG-SELECTANDNG-OPTIONSPS:其实看英文文档比看中...
AngularJS中使用Chart.js制折线图与饼图实例  Chart.js 是...
IE浏览器兼容性后续前言 继续尝试解决IE浏览器兼容性问题,...
Angular实现下拉菜单多选写这篇文章时,引用文章地址如下:h...
在AngularJS应用中集成科大讯飞语音输入功能前言 根据项目...
Angular数据更新不及时问题探讨前言 在修复控制角标正确变...