Comments (30)
these are 2 separate issues.
- ember objects not loaded during a specific phase of an ember app, end up anonymous. This is really an ember bug.
- having to import a FQN rather then "project local", this is more of an EAK + loader issue.
for 1 I have plans today to look into this and resolve it, but having the container itself inject the correct toString. This just mitigate the performance issue that lead to the whole anonymous name fallback existing in the first place.
for 2 some ideas exist to make the local aware of a "project local", but when "importing" ember objects within other ember objects you should be using embers own mechanism for this: e.g. this.controllerFor
, this.routerFor
, this.container.lookup
, 'this.container.lookupFactory, and finally
needs` and its corresponding controllers property
from ember-app-kit.
Ok.. Once again, thanks for the quick reply.
So, is there a way to work with Ember-Data models at the moment?
I've changed my model definitions to define toString at the class level. ie:
Project.reopenClass({
toString: function() {
return 'Project';
}
});
That gets rid of the anonymous model error message, however, I can't seem to set up belongsTo or hasMany relationships working. How should the relationship be defined in order to access the other entity?
from ember-app-kit.
I got caught up working on other issues/pr's yesterday. So hopefully as time permits I can make this work correctly this week.
The way ED get's type information and grabs associations isn't really friendly with the module stuff (yet).
To work around this, we do the following: https://github.com/yapplabs/glazier/blob/master/app/main.js + https://github.com/yapplabs/glazier/blob/master/app/main.js#L14 which allows https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/relationships/belongs_to.js#L15-L25
to work.
Changes to ember's toString are planned, as is how ED loads these models.
from ember-app-kit.
ok cool!
Thanks so much again
On Mon, Aug 26, 2013 at 2:31 PM, Stefan Penner [email protected]:
I got caught up working on other issues/pr's yesterday. So hopefully as
time permits I can make this work correctly this week.The way ED get's type information and grabs associations isn't really
friendly with the module stuff (yet).To work around this, we do the following:
https://github.com/yapplabs/glazier/blob/master/app/main.js +
https://github.com/yapplabs/glazier/blob/master/app/main.js#L14 which
allows
https://github.com/emberjs/data/blob/master/packages/ember-data/lib/system/relationships/belongs_to.js#L15-L25
to work.Changes to ember's toString are planned, as is how ED loads these models.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/87#issuecomment-23259173
.
from ember-app-kit.
https://github.com/emberjs/ember.js/pull/3209/files should fix the known issue here.
from ember-app-kit.
emberjs/ember.js#3209 should have fixed this, will reopen if its not.
from ember-app-kit.
@stefanpenner still seems to be an issue. I surfaced it again while working on builds.emberjs.com site
from ember-app-kit.
@stefanpenner I will try to fix and let you know
from ember-app-kit.
@twokul emberjs/ember.js@ffd9314 is likely related.
Ember-data itself needs some love to work correctly, maybe we can shim something for the current ED. That being said the jj-abrams branch aims to work out of the box. (likely with the Ember.ENV.MODEL_FACTORY_INJECTIONS
flipped to true.
from ember-app-kit.
So just to be clear, to make EAK work with current ember-data, do we need to set Ember.ENV.MODEL_FACTORY_INJECTIONS to true or to false and then load models via import
?
from ember-app-kit.
I think it has to be set to true and you have to use jj-abrams branch
thanks,
/alex
On Sun, Sep 1, 2013 at 9:34 PM, Joe Fiorini [email protected]
wrote:
So just to be clear, to make EAK work with current ember-data, do we need to set Ember.ENV.MODEL_FACTORY_INJECTIONS to true or to false and then load models via
import
?Reply to this email directly or view it on GitHub:
#87 (comment)
from ember-app-kit.
Is http://builds.emberjs.com/latest/ember-data.js from jj-abrams or master?
from ember-app-kit.
jj-abrams
was merged into master
last night (see emberjs/data@75f3174).
latest/ember-data.js is based on master (all the latest/
files are)
from ember-app-kit.
I can't seem to make this work, could you please do some documentation for this?
from ember-app-kit.
@neojp can you please provide an example of your issue? I cannot infer what the problem is you are having.
from ember-app-kit.
@stefanpenner I'm trying to port the Ember.js' Getting Started guide to use the App Kit.
But I'm stuck in the model section. It might have something to do with the Adapter, Model injection in the Route or the Model itself. Any insight would be most appreciated.
Hopefully once this is done we can link to it from the wiki since getting started with the app kit itself seems to have quite a learning curve.
https://github.com/neojp/TodoMVC-EAK/tree/master/app
from ember-app-kit.
i'll dig in tonight.
from ember-app-kit.
Thanks @stefanpenner!
from ember-app-kit.
I did start digging in, but ended-up catching some unrelated regressions and worked on sorting them out, which kept me from actually digging in.
from ember-app-kit.
@neojp using ember#1.1.0-beta.2
+ ember-data-shim#1.0.0-beta.3
+ placing the adapter in app/adapters/application
everything appears to work. example -> stefanpenner/EAK-sratch@115fd3a
feel free to submit pr's to that project if you have failing ED examples. I'll try and resolve them asap.
from ember-app-kit.
Thanks @stefanpenner! I finally got it working and noticed you are enabling Ember-Data support with the Fixture adapter from the start, excellent.
Here is the link to the Official TodoMVC demo app port to EAK. https://github.com/neojp/TodoMVC-EAK
from ember-app-kit.
@neojp ya I figured just including it by default would safe people some pains.
from ember-app-kit.
I couldn't agree more.
On Oct 1, 2013 7:40 AM, "Stefan Penner" [email protected] wrote:
@neojp https://github.com/neojp ya I figured just including it by
default would safe people some pains.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/87#issuecomment-25442269
.
from ember-app-kit.
model.get('constructor')
still return
(subclass of DS.Model)
and
model.toString()
return
"<(subclass of DS.Model):ember741:null>"
from ember-app-kit.
@KirillSuhodolov you should add Ember.MODEL_FACTORY_INJECTIONS = true;
or ENV.MODEL_FACTORY_INJECTIONS = true;
model.toString()
// => <appkit@model:balance::ember744:d9vs4>
model.get('constructor')
// => appkit@model:balance:
model.get('constructor.typeKey')
// => balance
i guess you are looking for model.get('constructor.typeKey')
from ember-app-kit.
fsmanuel you're right
thx!
from ember-app-kit.
@fsmanuel we should enable that by default in app.js
from ember-app-kit.
@stefanpenner right. i would prefer config/environment.js
over app.js
that's where i put it.
from ember-app-kit.
@fsmanuel sounds even better!
from ember-app-kit.
@stefanpenner done
from ember-app-kit.
Related Issues (20)
- Does EAK Support Inheritance With Controllers? HOT 3
- Suggestion: Defer loading of JavaScript HOT 1
- Recommended Folder Structure Using EAK HOT 4
- Migrating to Ember-CLI HOT 17
- Deploying to a non-root directory HOT 3
- Trouble with NPM scripts HOT 1
- 'grunt test:server' not work HOT 1
- Extending Store In EAK HOT 4
- EAK: Where do we place {{partials}} ? HOT 2
- ./config/environment.js example HOT 7
- `Cannot find module..." HOT 3
- Migrating to Ember-CLI Screencast HOT 2
- Importing shared ES6 modules futuristically HOT 2
- Added bootstrap-sass-official, Now Can't Push to Heroku HOT 2
- Stub API not working with server:dist task
- Transition into the loading substate
- Allow Ember Init and Generate for Coffeescript HOT 1
- Production build failed (grunt:dist) on fresh clone of EAK HOT 1
- Cannot deploy the 'ember app kit' app to heroku
- Update Ember CLI Migration Guide HOT 12
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 ember-app-kit.