0

Just started with Angular and trying to bind images. This error shows up after page load in chrome.

'Uncaught Object - MINNER ASSET: 22

<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/
angular.min.js"></script>
<script type="text/javascript">
        function DemoController($scope) {
            $scope.images = [
                { "src": "Images/1.jpg" },
                { "src": "Images/2.jpg" }                
            ];
        }
    </script>
</head>
<body>
<div ng-app="DemoApp" ng-controller="DemoController">
 <ul>
     <li ng-repeat="image in images">
        <img src="{{image.src}}" />
     </li>
 </ul>
</div>
</body>
2

2 Answers 2

5

Hi you miss var app = angular.module("DemoApp",[]);

 <!DOCTYPE html>
    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/
    angular.min.js"></script>
    <script type="text/javascript">
      var app = angular.module("DemoApp",[]);
      app.controller("DemoController",
            function DemoController($scope) {
                $scope.images = [
                    { "src": "Images/1.jpg" },
                    { "src": "Images/2.jpg" }                
                ];
            });
        </script>
    </head>
    <body>
    <div ng-app="DemoApp" ng-controller="DemoController">
     <ul>
         <li ng-repeat="image in images">
            <img ng-src="{{image.src}}" />
         </li>
     </ul>
    </div>
    </body>
    </html>
Sign up to request clarification or add additional context in comments.

Comments

0

You haven't defined DemoApp, you can skip the app name.

<div ng-app ng-controller="DemoController">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.