Tuesday, 10 September 2013

angularjs basic todo example refuses to work

angularjs basic todo example refuses to work

I have the following page I am working on (it is taken from the official
angularjs todo example page)
doctype 5
html(ng-app)
head
title myapp
script
var photos = !{JSON.stringify(photos)};
body
div#header-wrapper(ng-controller='PhotosCtrl')
div.col-wrap#header
div.col-2.offset-1: div.fixed-height#logo
div.col-wrap.padded#divisor Welcome
div.col-wrap.center
div.col-19#main
div.item(ng-repeat='photo in photos')
p.desc(ng-model='photo.desc')
script(type='text/javascript',
src='http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.1.5/angular.min.js')
script(type='text/javascript', src='/js/app.js')
//app.js
function PhotosCtrl($scope){
$scope.photos = photos;
};
the photos object looks like this:
[
{ url:"http://example.comimage.jpg", desc:"this is a picture" },
{ url:"http://example.comimage.jpg", desc:"this is a picture" },
];
but nothing is showing in my #main div. Any idea why?

No comments:

Post a Comment