javascript - routing with angular js and expressjs -
I am trying to start a project with express and angle. I was following the guide for the first time running, to run local location: 3000, I have successfully loaded my index.jade file into the visual directory. Index.jade
Layout block content div ng- includes footers in the scene footerjs.jade
script ( Script (src = "/ javascripts / angular-route.js") script (src = "/ javascripts / angular-resource.js") script (src = "/ javascripts / angular.min.js") script (src = "/ javascripts" / App.js ") script (src =" / javascripts / task.js ") There is a folder called partial in the visual directory. I have added two templates inside this folder. .jade "and" landing.jade ".
My app.js
var mainApp = angular.module ('mainApp', ['ngRoute', 'TaskApp', 'ngResource', 'ui.router' ]); MainApp.config (('$ routeProvider', '$ locationProvider', function (route provider, location provider) {locationProvider.html5Mode (true); '}}. (' / Work ', {templateUrl:' partial / work ', controller:' task controller '}) otherwise ({redirectTo:' / '});}]); And I have created an expressway:
router.get ('/ partial /: urlName', function (rick, res) {res .render ('partial /' + Req.params.urlName);}); I can not route any partially I am initially stuck on my layout and the error in trying the route / work is at 404. Any help would be greatly appreciated.
Comments
Post a Comment