HTML
<section ng-app="app">
<table ng-controller="VoicemailsCtrl">
<caption>{{test}}</caption>
</table>
</section>
JS
var app = angular.module('app', [])
.controller('VoicemailsCtrl', ['$scope', VoicemailsCtrl]);
function VoicemailsCtrl($scope, $http)
{
$scope.vms = [1,2,3];
$scope.test = 'this is a test';
}
可见于:
最佳答案
您错过了添加
ng-app="应用程序"
在部分。
检查更新的 fiddle Fiddle
除此之外,您还需要添加
angular 1.2.1
和
No wrap in head
在框架和扩展中。 .
关于javascript - 简单的 Angular 代码不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31594451/