0

I am working on web project where i am working on angular js to display images and if i click an image it will zoomed. I have created one sample application its working fine but when i started to create one sample application it gives warning for its internal tags.

My Html file where it gives warnings(for ng-app,ng-controller,ng-src,ng-repeat) ..

<!DOCTYPE html>
<html ng-app>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- <script src="http://code.angular.org/angular-1.0.0rc4.min.js"></script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script> -->

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.6/angular.min.js"></script>

<script src="${pageContext.request.contextPath}/js/underscore-min.js"></script>

<link rel="stylesheet"
    href="${pageContext.request.contextPath}/css/bootstrap.min.css" />
<script src="${pageContext.request.contextPath}/css/album.css"></script>

<title>Angular album</title>

</head>

<body>
jsp

<div ng-controller="AlbumCtrl">
<div id="albumImage">
<img ng-src="{{currentImage.image}}" alt="{{currentImage.description}}">

</div>

<div id = "thumbWrapper">
<ul id="thumbList">
<li ng-repeat ="image in images"  ng-click="setCurrentImage(image)">
<img ng-src="{{image.thumbnail}}" alt="{{image.description}}">

</li>
</ul>

</div>

</div>
</body>
</html>
5
  • What happens if you add the Javascript at the bottom of the body? Commented May 16, 2013 at 16:10
  • @Matt which javascript are you talking about.. Commented May 16, 2013 at 16:12
  • Sorry, I meant the script tags. I'm not too well versed with Angular but I know that with Backbone I've had problems when defining templates after adding the JS source files. Commented May 16, 2013 at 16:13
  • where's your AlbumCtrl code? Commented May 16, 2013 at 16:27
  • post your controllers code and main angular module, post the warnings Commented Dec 9, 2014 at 14:45

1 Answer 1

2

Seems that your problem is here:

<div ng-controller="AlbumCtrl">

I don't see where this controller is defined. It's possible you got your file extension wrong, and that's why:

<script src="${pageContext.request.contextPath}/css/album.css"></script>
<!-- I would have expected to see .js, not .css, in the path above -->
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.