Using Hackathon-starter-angular (HSA) does not answer the questions that were mentioned in the post. HSA includes AngularJS globally in the layout.jade file, which may mean that all routes are served by AngularJS and these pages are not indexed by search engines such as google.
/ AngularJS hackathon-starter - . :
1) , . , . angularEntry.js
exports.getPagesServedByAngular = function (req, res) {
res.render('shop/index', {
title: 'Entry point to AngularJS pages'
});
};
2) app.js
var angularPagesController = require('./controllers/angular');
app.get('/shop', angularPagesController.getPagesServedByAngular);
3) (, ) (, index.jade). Angular. :
extends ../layout
block content
.page-header
h3 Services
body(data-ng-app='miniApp')
p first test expression from views/index.jade: {{ 5 + 5 }}
div(data-ng-view)
4) app.js public/js -. :
angular.module('miniApp', ['ngRoute']);
angular.module('miniApp').config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'views/test.html'
})
.when('/detailTest', {
templateUrl: 'views/detailTest.html'
})
});
5) angular.js angular -route.js public/js/lib
6) public/js/application.js :
//= require lib/angular
//= require lib/angular-route
//= require app
7) , test.html detailTest.html public/views
Angular. , / public/js.