0
<div class="container">
<div class="row" style="padding-top:50px" ng-controller="projects_control">
<div class="col-md-12">
<ul class="media-list">
<li class="media" ng-repeat="project in projects">
<div class="media-left media-middle">
<a href="#"><img ng-src="{{project.image}}"></a>
</div>
<div class="media-body">
<h2 class="media-heading">{{project.name}} <span class="label label-danger label-xs">{{project.status}}</span>
</h2>
<p>{{project.short_description}}</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<script src="angular.min.js"></script>
<script>
var app = angular.module("mmproapp",[]);
app.controller=("projects_control", ["$scope", function($scope){
$scope.projects=[{
image:"Aliens.jpg",
name:"Quadcopter",
status:"Currently under work",
short_description:"This would be a short description about the project that would have atleast 5-6 lines explaining in short about the main goal of the project along with the major difficulty or something like that. Just to fill this description box.",
long_description:"HCHCKGKJ>LGHCB>KLKYFIUKUJC"
},
{
image:"daily_tasks.jpg",
name:"Something",
status:"Finished",
short_description:"kmsegadkuyag;klusdglujwecliwe This would be a short description about the project that would have atleast 5-6 lines explaining in short about the main goal of the project along with the major difficulty or something like that. Just to fill this description box.",
long_description:"HCHCKGKJ>LGHCB>KLKYFIUKUJC"
}];
}]);
</script>
ng-controllerと一緒にng-controllerを使って、私のページに多くのプロジェクトをメディアフォーマットで表示したいのですが。これは私が書いたコードです。しかし、私はそれを実行するたびに、何もその場所に表示されません。空白になる前に、コンテンツ(何が理想的に送信されたはずでしたか)が約0.5秒間点滅します。私が見るのは空白のページだけです。親切にも、私のコードが間違っていると教えてください!私は見当もつかない。ng-repeat属性が機能しません。私はangularJsを使用していますが、ng-repeatは機能しません。ここに私のコードです
はありませんか? –
'app.controller'の後に等号を削除します。これは 'app.controller(" projects_control "、...)'でなければなりません。 – Lex
@Lexそれを指摘してくれてありがとう。それは私にとっては分かりにくい小さな誤りでした。再び、ありがとう。感謝します。 –