AngularJS ng reapeat不在浏览器中渲染
我的浏览器仅呈现:“{{cust.name+,'+cust.city}” index.htmlAngularJS ng reapeat不在浏览器中渲染,angularjs,Angularjs,我的浏览器仅呈现:“{{cust.name+,'+cust.city}” index.html <!DOCTYPE html> <html data-ng-app="demoApp"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=Edge">
<!DOCTYPE html>
<html data-ng-app="demoApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
html, body, input, select, textarea
{
font-size: 1em;
}
</style>
</head>
<body>
<div data-ng-controller="SimpleController">
Name :
<br>
<input type="text" data-ng-model="name">
<br>
<ul>
<li data-ng-repeat="cust in customers">{{ cust.name + ',' + cust.city }}</li>
</ul>
</div>
<script>
var demoApp = angular.module('demoApp', []);
var controllers = {};
controllers.SimpleController = function ($scope) {
$scope.customers = [
{name:'John', city:'Paris'},
{name:'Andy La', city:'Londra'},
{name:'George', city:'Berlin'}
];
});
demoApp.controller(controllers);
</script>
</body>
<script src="Scripts/angular.min.js"></script>
</html>
html、正文、输入、选择、文本区域
{
字号:1em;
}
姓名:
- {{cust.name+,'+cust.city}
var demoApp=angular.module('demoApp',[]);
变量控制器={};
controllers.SimpleController=函数($scope){
$scope.customers=[
{姓名:'John',城市:'Paris'},
{姓名:'Andy La',城市:'Londra'},
{姓名:'George',城市:'Berlin'}
];
});
demoApp.controller(控制器);
我的代码有问题吗???有什么想法吗?我能做什么?
我从其他网站和其他人那里尝试了一些其他想法,但都不起作用。我不知道我还能做什么。
我对angularJS很陌生
谢谢 您需要在
主体
标记中引用angular.js脚本
最后你还有额外的妄想症,把它去掉
演示
var demoApp=angular.module('demoApp',[]);
变量控制器={};
controllers.SimpleController=函数($scope){
$scope.customers=[
{姓名:'John',城市:'Paris'},
{姓名:'Andy La',城市:'Londra'},
{姓名:'George',城市:'Berlin'}
];
};
demoApp.controller(控制器)代码>
姓名:
- {{cust.name+,'+cust.city}
试着把你的名字放在标题中,不要放在你的名字后面。谢谢。Pb解决:)它起作用了!非常感谢你。改变一切的小细节:)我在很多方面改变了代码,但我没有找到pb。好吧!我做到了!再次感谢你!