Comments (4)
I have the same problem and the same error after adding a view to my project. When I try to access the App variable from the browser console, I get this error: ReferenceError: App is not defined. But App is available after running this in the console: App = require('app')
Afterwards the view is could be appended to the DOM by running: App.ImageView.create().append()
But is there a way to get views working in an Ember template?
from brunch-with-ember-reloaded.
For me it works to define App = require 'app'
in initializer.coffee as a global variable. I did the following:
- Changed
App = require 'app'
to@App = require 'app'
in initializer.coffee - Added the @-sign to all other calls for App in this file
- Deleted
require 'app'
in all files for routes, controllers, models, views and so on. - Replaced
module.exports = App.Something = Ember.Something.extend
with@App.Something = Ember.Something.extend
- Changed
{{ view App.SomeView }}
to{{ view @App.SomeView }}
(It also works with{{ view App.SomeView }}
)
After this changes my views were rendered correctly and the App variable was available from the browsers console.
I hope this will help.
from brunch-with-ember-reloaded.
I've just finished battling with a very similar problem, for which the solution might be the same: when defining models with any kind of relationship (hasMany
, belongsTo
) to other models, those related models are not found and the initial model can't load (You specified a hasMany ([model 2]) on [model 1] but [model 2] was not found.
, leading to an Error while loading route: [...]
).
It seems Ember needs the App
object to be available globally, as is done in Brunch with Hampsters: in initialize.coffee
, line 1 is
window.App = require 'app'
instead of
App = require 'app'
which makes related models work like a charm. It strikes me as the same problem.
from brunch-with-ember-reloaded.
Closing because I've stopped using this skeleton. Moved to ember-cli.
from brunch-with-ember-reloaded.
Related Issues (14)
- brunch g doesn't work HOT 1
- Problem creating skeleton HOT 2
- Switch to stravid/ember-handlebars-brunch fork HOT 11
- The cleanest way to add Jade HOT 2
- problem with tests HOT 1
- Ember no longer requires underscored names for partials
- Installing NPM packages doesn't stop the previously running server HOT 2
- first time pull, broken HOT 2
- didInsertElement causes brunch not to compile HOT 3
- Weird Template Error in ember. Ember-HandleBars-Brunch broken in 1.0.4? HOT 7
- Default config.js is not creating vendor.js at windows HOT 2
- es6 branch bug - es6 needs to run before javascript-brunch HOT 1
- Why including full Handlebars? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brunch-with-ember-reloaded.