#emberjs

/

      • jkarsrud
        It might be worth a shot, it's gotten pretty solid
      • tyleri has quit
      • T-Co
        jkarsrud, Does ember-cli support crafting the index.html by injecting the built js and styles for production and such?
      • jkarsrud
        we use ember-cli on all our ember projects now, and quite honestly I can't see why you wouldn't use it for new projects
      • scottned has quit
      • T-Co: Yep
      • T-Co
        I have to give it a go then
      • jkarsrud, Can I run test with mocha and expect.js?
      • jkarsrud
        not sure about expect.js, but you have https://github.com/switchfly/ember-cli-mocha for mocha testing
      • T-Co
        cool
      • I have karma now running mocha and expec.js
      • There is a lot of migrating to be done. Let's see if I have the time to take it all in :)
      • bogdanbalc joined the channel
      • jkarsrud
        right. Shouldn't be a problem to get it over to testem + mocha and expect though
      • I don't know if there are plans to make the runner pluggable
      • lolmaus has quit
      • T-Co: maybe you should try it on a new project, to get to know it a bit better, and know if you can take the time to migrate? :)
      • edwinvdgraaf joined the channel
      • edwinvdgraaf has quit
      • edwinvdgraaf joined the channel
      • ungue joined the channel
      • babykosh has quit
      • lbarratt joined the channel
      • SomeKittens has quit
      • krz has quit
      • gunn has quit
      • amk_221 joined the channel
      • kroofy joined the channel
      • kroofy_ joined the channel
      • shafox has left the channel
      • gunn joined the channel
      • kroofy has quit
      • lbarratt has quit
      • fizz has quit
      • lessless joined the channel
      • pereira_alex joined the channel
      • pereira_alex has quit
      • pereira_alex joined the channel
      • gburnett joined the channel
      • tr3online has quit
      • alex_diliberto joined the channel
      • MrMcDowall joined the channel
      • amk221 has quit
      • pzu joined the channel
      • MrMcDowall has quit
      • bengillies joined the channel
      • samselikoff joined the channel
      • sprinkle joined the channel
      • alex_diliberto has quit
      • sprinkle
        hello!
      • Hello! I know it's not a good practice to declare a model inside a controller. Anyone knows how to declare a model inside a controller without using a route?
      • koriroys joined the channel
      • samselikoff has quit
      • lbarratt joined the channel
      • jlle joined the channel
      • pzu
        sprinkle: So like instantiating a model inside a controller?
      • What are you trying to do exactly?
      • sprinkle
        yes @pzu
      • annlewis joined the channel
      • I have a modal-dialog and I am not using a route for it
      • but I need to get a different model than from the parent controller
      • adamsrog has quit
      • pogopaule joined the channel
      • pzu
        sprinkle: Well you could use route actions to instantiate the model
      • sprinkle
        but inside the controller?
      • T-Co
        jkarsrud, Yeah. I have 2 ongoing projects now using Ember. Let's see if I have the time to look into it with the third :)
      • jkarsrud
        sprinkle: You could pass a model into the action that opens the dialog and set that as the model on the dialog-controller
      • pzu
        Actions can be triggered from within the controller, I would put this particular action on the route for separations of concerns
      • annlewis has quit
      • controllers tend to be computed properties and state, routes tend to be data management
      • bel3atar has quit
      • bel3atar joined the channel
      • krz joined the channel
      • pogopaule
        is it correct that the itemController in #each is deprecated? thought this would be case, but I can not find any information on this...
      • amk_221
        how do you create a readonly computed property in the non-prototype extension way?
      • sprinkle
        but I have a parent with some list, already with a modal. When I click to open the modal, I have the openModal action. But the model for the modal, is totally different than the one from the parent
      • jkarsrud
        pogopaule: Not sure if it's deprecated just yet, but I think they plan to do it as they remove controllers completely
      • amk_221: Does it need to do something special, or will this work? http://emberjs.com/api/classes/Ember.computed.h...
      • Zumanex has quit
      • pogopaule
        jkarsrud: ok thanks
      • xBBTx joined the channel
      • Bear10 joined the channel
      • sprinkle
        jkarsrud: but how can I have 2 different models in a route?
      • yaymukund has quit
      • jkarsrud
        sprinkle: you *pass* it in through the action, you don't use the model from the parent
      • `?
      • martndemus joined the channel
      • sprinkle
        but I need to use a different model on the parent.
      • wez joined the channel
      • wez is now known as Guest52286
      • anix joined the channel
      • pzu
        sprinkle: So you can render the modal with a different controller
      • and set the model on *that* controller
      • sprinkle
        yes, I am doing that. It's a different controller
      • and I have the model defined on that controller, but Ember is ignoring that model
      • pzu
        so you can set the model on that controller via the action that triggers the modal
      • can you gist your code?
      • david____ joined the channel
      • david____ is now known as sprinkle_
      • sprinkle has left the channel
      • sprinkle_ is now known as sprinkle
      • vvs-code_ joined the channel
      • teufelChiCoder has quit
      • martndemus
        Is there maybe an upgrade guide for migrating to a prototype extension-less addons? Not really sure how `.observes('foo').on('init')` should be migrated.
      • keimlink joined the channel
      • amk_221
        jkarsrud: I'm being daft, that's what I want, but I only know how to use it .property().readOnly() How do you do Ember.computed.readOnly?
      • jkarsrud
        Like they do it in the example?
      • amk_221
        martndemus: that's my problem too. I don't know how to chain them
      • jkarsrud
        Ember.computed === .property()
      • vvs-code has quit
      • Ember.computed.readOnly === .property().readOnly()
      • amk_221
        right
      • martndemus
        do i `on('init', observer('foo', function() { }))`
      • sprinkle
      • amk_221
        martndemus: not sure. would like to know
      • jkarsrud: ty
      • goodenough joined the channel
      • martndemus: that does actually work for me.
      • martndemus
        I haven't tested it tbh, I at first wrote fooDidChange:
      • `fooDidChange: observer('foo'), initFoo: on('init', function() { this.fooDidChange() })`
      • amk_221:
      • jkarsrud
        amk_221: I think you can chain them though?
      • sandstrom has quit
      • yaymukund joined the channel
      • martndemus
        jkarsrud: observer().on() does not chain without prototype extension
      • jkarsrud
        what about the other way?
      • martndemus
        thats possible
      • because observer returns a function
      • jkarsrud
        I was thinking they might return something from 'on' that would make it chainable
      • ah, so does on
      • so I guess they're not chainable then
      • but actually separating them seems to be a better pattern to me anyway, because they could call "private" methods
      • sandstrom joined the channel
      • T-Co
        jkarsrud, When using link-to and I have a nested route. How to retain the first id and just change the latter?
      • jkarsrud
        you need to pass both
      • iirc
      • when they both have dynamic segments, I mean
      • zcourts joined the channel
      • pogopaule has quit
      • tr3online joined the channel
      • vanne has quit
      • vanne joined the channel
      • martndemus
        Does anyone have a clue what 'Properties can only be defined on Objects.' means, stack trace is not helping me. Is also triggered by disabling PE.
      • tr3online has quit
      • jkarsrud
        martndemus: are you trying to make a property on something that's not an Ember.Object?
      • einarj joined the channel
      • martndemus
        jkarsrud: not that i know of
      • bengillies has quit
      • bengillies joined the channel
      • mszrnyi joined the channel