node.js - Add Prerender.io to Existing angularJS webapp -
ive been trying setup angular webapp work prerender.io app not have of built in middleware desire; have decided want work express.js tutorials set project using this.
i able create project works prerender if make new using express.js generator plugin. thats , dandy doesn't me out; not creating project, rather want add prerender existing project. there way create new express.js project , import entire angular app (with folder structure; etc, moving app's root directory on new express app)into , have routing etc unaffected?
how 1 go adding prerender created angularjs webapp? (like basic 1 seen below) i've tried bunch of times throughout day , ended installing ton of ugly dependancies project , having delete them all; appreciated. ::
app.js:
// app.js
var app = angular.module('mypremadeapp', ['ngroute']) $locationprovider.hashprefix('!'); .config(function($routeprovider, $locationprovider){ $routeprovider.when('/', { templateurl : 'views/homeview.html', controller: 'homecontroller' }) .when('/about', { templateurl : '/views/aboutview.html', controller: 'aboutcontroller' }) .when('/features', { templateurl : '/views/featuresview.html', controller : 'featurescontroller' }) .otherwise({ redirectto : '/' }); }); function maincontroller($scope) { $scope.seo = { pagetitle : '', pagedescription : '' }; } function homecontroller($scope) { $scope.$parent.seo = { pagetitle : 'setup thing', pagedescripton: 'stuff description' }; } function aboutcontroller($scope) { $scope.$parent.seo = { pagetitle : 'about', pagedescripton: 'we content heavy website need indexed.' }; } function featurescontroller($scope) { $scope.$parent.seo = { pagetitle : 'features', pagedescripton: 'check out of our awesome features!' }; }
Comments
Post a Comment