javascript - Why is ng-repeat being commented out my MEAN stack app? -
i trying simple tracer bullet mean stack application. stuck on trying app.js file in server communicate app.js in views. here index.html
<!doctype html> <html ng-app="allinone"> <head> <link rel="stylesheet" type="text/css" href="/stylesheets/bootstrap.min.css" /> <link rel="stylesheet" type="text/css" href="/stylesheets/normalize.css" /> <link rel="stylesheet" type="text/css" href="/stylesheets/xxx.css" /> <script type="text/javascript" src="/src/angular.min.js"></script> <script type="text/javascript" src="/src/app.js"></script> </head> <body> <!-- header --> <header> <h1 class="text-center">xxx</h1> <h4 class="text-center">all in one</h4> </header> <!-- containers / content --> <div class="container"> <!-- stack columns on mobile making 1 full-width , other half-width --> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-8 content-prime"> <h3> .col-xs-12 .col-sm-6 .col-md-8. </h3> <div class="notice-pre-content"> holy crap here's alert, or factoid </div> <p>lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s, when unknown printer took galley of type , scrambled make type specimen book. has survived not 5 centuries, leap electronic typesetting, remaining unchanged. popularised in 1960s release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.</p> </div> <div class="col-xs-6 col-md-4 nav-prime"><h3>.col-xs-6 .col-md-4.</h3><p>navigation on right can go here. yep yep yep. on right side. here is. yaaargghh. yep. yep. yep. navigation on right can go here. yep yep yep. on right side. here is. yaaargghh. yep. yep. yep.</p></div> </div> <div class="row"> <div class="col-xs-6 col-sm-4">bot left, m8.</div> <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div> <!-- optional: clear xs cols if content doesn't match in height --> <div class="clearfix visible-xs-block"></div> <div class="col-xs-6 col-sm-4"><h5>.col-xs-6 .col-sm-4. bot right.</h5></div> </div> </div> <div> <ul ng-contoller="testcontroller"> <li ng-repeat="element in list"> {{element}} </li> </ul> </div> <!-- footer --> <footer> <h5 class="text-center">link dump: google+, facebook, twitter, green initiative, member fdic </h5> </footer> </body> </html>
i think problem within ng-controller not sure.
<div> <ul ng-contoller="testcontroller"> <li ng-repeat="element in list"> {{element}} </li> </ul> </div>
server/app.js
let express = require("express"); let app = express(); app.use( express.static(__dirname + "/../views") ); let bodyparser = require('body-parser'); let jsonparser = bodyparser.json(); app.get("/test", (request, response) => { response.json( ["hello", "world"]); }); app.listen(81, 'codeone2016.erikshafer.me');
views/src/app.js
var app = angular.module('allinone', []); app.controller('testcontroller', ($scope, $http) => { $http.get('/test') .success(function(response) { console.log(response); }) $scope.results = response.results; });
Comments
Post a Comment