这是我的第一个angularjs页面,它不适用于php


This is my first angularjs page and its not work with php

我正在关注视频演示,但我无法获得像视频演示那样的结果。。我的代码如下:

<!DOCTYPE html>
<html ng-app>
<head>
	<title>Angular Practice</title>
	<script
		src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js" >
	</script>
</head>
<body ng-controller="TodosController">
<div>
	<label for="name"> Name: </label>
	<input type="text" ng-model="name" />
	<hr>
	<h1> Hello {{name}} </h1>
</div>
</body>
</html>

我的输出是

在此处输入图像描述

移除ng-controller="TodosController"。您没有在此处指定任何控制器!

<!DOCTYPE html>
<html ng-app>
<head>
	<title>Angular Practice</title>
	<script
		src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js" >
	</script>
</head>
<body>
<div>
	<label for="name"> Name: </label>
	<input type="text" ng-model="name" />
	<hr>
	<h1> Hello {{name}} </h1>
</div>
</body>
</html>

相关文章: