AngularJS 控制器未在 jsFiddle 中执行

AngularJS controller not executing in jsFiddle

我试图在 AngularJS 中学习控制器和模块的最基本实现。

Here is the code I have tried:

var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
    $scope.firstName= "John";
    $scope.lastName= "Doe";
});
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="myApp" ng-controller="myCtrl">
<h1>
    This is the most <a href='http://www.w3schools.com/angular/tryit.asp?filename=try_ng_intro_controller'>basic angularJS controller</a> implementation
    </h1>
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{ firstName + " " + lastName }}

</div>

输出未更新:

只是一个小问题,

Angularjs 脚本未被引用。改成包在头里就可以了,

这是工作JsFiddle

您需要select No wrap - in <body>Frameworks and extensions选项卡的下拉菜单中,查看图片:

已更新JSFiddle