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는 작동하지 않습니다. 여기 내 코드는

+0

가 없다? –

+3

'app.controller' 다음에 등호를 제거하십시오. 그것은'app.controller ("projects_control", ...)'이어야합니다. – Lex

+0

@Lex 고맙습니다. 그것은 나를위한 작은 식별 불가능한 오류였습니다. 다시 한번 고마워요. 고맙습니다. –

답변

0

애플리케이션에 약간의 오류가 있습니다. 이 plunker를 참조하십시오. 코드의 전체 예제입니다. 또한 콘솔에서 오류를받을 수 있나요 더 NG-응용 프로그램 지침

https://plnkr.co/edit/0FZVMoPkMyLUJh4dsRdf?p=preview

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" 
     }]; 

    }]); 
관련 문제