Bitte schauen Sie auf den folgenden Code:AngularJS: Warum funktioniert nicht ng-repeat?
<html lang="en" >
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
<script src="app.js"></script>
</head>
<body ng-app="flexbox" >
<div id="wrapper" ng-controller="flex-ctrl as ctrl">
<div id="aside">
<p ng-repeat="item in ctrl.buttons"> {{item}} </p>
</div>
</div>
</body>
</html>
var app = angular.module("flexbox", []);
app.controller("flex-ctrl", ['$scope', function($scope) {
$scope.buttons = ['a','b', 'c'];
}]);
Ich erwarte, dass drei <p>
Artikel zu sehen. Es sieht jedoch so aus, als ob ng-repeat ignoriert wird und ich eine leere Seite sehe.
Weißt du, was das Problem ist?
Für Ihre Bequemlichkeit: http://codepen.io/CrazySynthax/pen/yVwWdo
nur Strg entfernen –