Generate Normal Object


#1

Hi,

Is there a command (there doesn’t seem to be) to create a normal Ember “object” as mentioned: https://guides.emberjs.com/v2.18.0/object-model/classes-and-instances/


#2

Well there’s the <ObjectClass>.create() method or did you mean something else?


#3

I meant an ember generate command


#4

ah well they aren’t really a normal part of an ember project in the sense that you just define ember objects, closest thing is probably a util (that’s where i would put them anyway).


#5

Well, you can generate a blueprint that fit your need. https://ember-cli.com/extending/#defining-a-custom-blueprint


#6

I can’t understand why they are not a normal part of an ember project? Don’t tell me people are sticking their functionality into components only.

Mix-ins could work, but someone has said they are discouraged for some reason, and they are not documented well at the guides/tutorials.


#7

Thanks. Seems like an obvious thing that there should be ember generate object MyConfig or something


#8

Actually scratch that out, a utility looks just like an Ember Object. I think that’s my missing link I’ve never used Util before but it looks like my new friend.


#9

Actually I put most functionality into ember-concurrency tasks sitting on ember services. Just as a suggestion.