I started studying Angular and there was a problem with ng-include.
Here is an example , only without the add and remove function.
And this piece "below" I want to put in a separate file. Question: "How?". If I bear it, then it is not loaded.
<script type="text/ng-template" id="tree_item_renderer.html"> {{data.name}} <ul> <li ng-repeat="data in data.nodes" ng-include="'tree_item_renderer.html'"></li> </ul> </script>
This is if running under the nodejs server. But if you just run as html page, then everything works as I want. What's wrong?
Here is the server code:
var port = process.env.PORT || 8080; app.use(express.static(__dirname + '/app')); require('./app/routes')(app); // pass our application into our routes app.listen(port); console.log('Magic happens on port ' + port); exports = module.exports = app;
Request URL:http://localhost:3000/treeTemplate.html Type:xhr Request Method:GET Status Code:304 Not Modified Remote Address:127.0.0.1:3000 Response Headers accept-ranges:bytes cache-control:public, max-age=0 connection:close date:Fri, 15 Jul 2016 19:14:59 GMT etag:W/"c6-155e0841587" last-modified:Tue, 12 Jul 2016 19:10:00 GMT x-powered-by:Express Request Headers Accept:application/json, text/plain, */* Accept-Encoding:gzip, deflate, sdch Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4 Cache-Control:max-age=0 Connection:keep-alive Host:localhost:3000
- Dmitriy