node.js - Difficulty using seperate template files in ember router with browserify -


I have my backend node. I have followed this tutorial to set up the JS server, but instead of using spine-meriant for foreground, I want to try Amber. Therefore, after successfully setting up the server, I am now using Amber I am going through this tutorial.

The problem I am running includes external templates in my amber routes. The app works fine with this code and Todo template written in the browser.

  var Ember = require ('ember'); Window. Tados = amber application. Create (); Todos.Router.map (function () {this.resource ('todos', {path: '/'})}};  

However, with template ./templates/application Written in .hbs and using the browser to try it,

  Todos.routor.map (function () {This.resource ('is required (' .templates / application .hbs'), {path: '/'})}};  

I get the errors given below.

  Unkit type error: undefined There is no function myapp.js: 46841 Error: Prohibition failed: URL '/' error in error (original) on any of your application Also did not match the route. Ember.Error (http: // localhost: 3300 / js / myapp.js: 12 978: 19) at Object.Ember.assert (http: //localhost:3300/js/myapp.js : 12141: 11) at http: // localhost: 3300 / js / myapp.js: 47347: Call on call 15 (http: // localhost: 3300 / js / myapp.js: 22081: 19) (published on Publish to http: // localhost: 3300 / js / myapp.js: 21751: 9) (http: // localhost: 3300 / js / myapp.js: 22179: 7) at http: / object / localhost: 3300 /js/myapp.js:30448:7 Object. Defrank ActionQuiz. Full (http: // localhost: 3300 / js / myapp.js: 18195: 24) on the object. Backbanner.ed (http: // localhost: 3300 / JS / Myup.jes: 18283: 27) myapp.js: 15589 Unfair error: Expiration failed: Error: Prohibition failed: URL '/' Match any route in your app Do not eat  

I was hoping someone would give some light about the inclusion of an external template in Amber Router thanks!

Thanks for watching! I think I had a bad job explaining my question - I knew that this template was name, but I did not understand how to include it in my application I searched a bit more and I > Grunt-ember-templates found.

For future reference, you have really good docs that you have to set up, this is my amber template code like

  emberTemplates: {compile: {options: {templateBasePath: 'client / src / templates'}, files: {' build / templates.js': ['clients / src / templates / * .hbs']}}},  

And then I just added my code as my code as' application '. Do not forget to build / compile all in your app build.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -