#emberjs

/

      • edwinvdgraaf has quit
      • edwinvdgraaf joined the channel
      • munumnu has quit
      • kanja
        is there a way to observe a key stored in a variable?
      • ie .property(foo, "foo") where foo = "someProperty"
      • bel3atar joined the channel
      • ForSpareParts joined the channel
      • evanjs joined the channel
      • tyleri has quit
      • wallerdev joined the channel
      • Grapho
        kanja: not sure what that means? i assume you do not mean to observe a property on an object though... property('foo.someProperty')
      • evanjs is now known as evanfreeman
      • ericchernuka has quit
      • jdtx joined the channel
      • tyleri joined the channel
      • yaw joined the channel
      • bbl
      • hyperlink has quit
      • solirvine joined the channel
      • amk221 has quit
      • evanfreeman has quit
      • bantic joined the channel
      • Guest9000 joined the channel
      • solirvine has quit
      • evanfreeman joined the channel
      • jonerer joined the channel
      • viiralvx has quit
      • thejchap has quit
      • bantic has quit
      • jlle joined the channel
      • TeknoFiend has quit
      • chrishough has quit
      • TeknoFiend joined the channel
      • annlewis_ joined the channel
      • vvs-code has quit
      • annlewis has quit
      • solirvine joined the channel
      • lolmaus joined the channel
      • thejchap joined the channel
      • aroberts has quit
      • solirvine has quit
      • kanja
        Grapho: I do want to property on an object - it's just that which specific property can change so I want to observe the value of a variable
      • aroberts joined the channel
      • joe0185 joined the channel
      • joe0185
        anyone else look at the generated output for HTMLBars, seems to generate a ton of garbage
      • NOTICE: var el3 = dom.createTextNode("\n ");
      • NOTICE: dom.appendChild(el2, el3);
      • samselik_
        is it possible to update an {{input}}'s val in a component unit test, and have it trigger bindings?
      • Eskimofo
        i have just found https://github.com/dockyard/ember-validations. is it possible (and a good idea) to INJECT it into my models? (instead of using the mixin in each model)
      • Grapho
        Eskimofo: mixin
      • jonerer has quit
      • joe0185 has quit
      • jlle has quit
      • tubbo joined the channel
      • Eskimofo: injecting the validations would be assuming it is a standalone service, which it is not
      • datazombie has quit
      • tyleri has quit
      • Eskimofo
        Grapho why, does it have depandencies?
      • wayne- has quit
      • evanfreeman has quit
      • TeknoFiend has quit
      • Akii joined the channel
      • choernig has quit
      • evanfreeman joined the channel
      • wookiehangover has quit
      • evanfreeman has quit
      • evanfreeman joined the channel
      • qwebirc19092 joined the channel
      • Grapho
        well the mixin taps into the objects init() method to run all its setup
      • tyleri joined the channel
      • if it were in a service, it could not do that
      • jmeas has left the channel
      • tubbo has quit
      • gannetson joined the channel
      • qwebirc19092
        how can you set a default template to be render in the {{outlet}} of another template?
      • Grapho
        if it were a service it would need to be designsed to juggle all the validations within itself, rether than letting each object control itso own validationd
      • qwebirc19092
        For example, if I had an ‘assignments’ template that would render all the assignments in the {{outlet}} by default and other stuff when they click other links?
      • wookiehangover joined the channel
      • alan_andrade joined the channel
      • Grapho
        qwebirc19092: the 'assignments' would actually want to be the index template for that route.. if you want it in the outlet by default.
      • qwebirc19092
        do i follow a file naming convention to create an index for a template
      • if im using ember cli?
      • like assignments.index.hbs?
      • Grapho
        e.g. assignments.index = app/templates/assignments/index.hbs
      • qwebirc19092
        ah ok
      • thank you
      • tubbo joined the channel
      • Grapho
        your other routes would be like assignments.new... assignments.edit... assignments.whatever
      • qwebirc19092
        great!
      • Eskimofo
        Grapho ok thanks. i will use it as a mixin
      • TeknoFiend joined the channel
      • shinnya joined the channel
      • Grapho
        Eskimofo: the other benefit of a mixin is it would allow you to validate the same model differently depending on what controller it is on.. but anyway good luck!
      • ForSpareParts joined the channel
      • dagda1_ joined the channel
      • darrin has quit
      • bkaney has quit
      • gmurphey has quit
      • samselik_
        is it possible to use `fillIn` helper in a component unit test?
      • highcup
        Is the way to create something like a singleton to use an initializer?
      • gmurphey joined the channel
      • I've got a resource that I want to keep track of -- you can only ever have one of this resource at any given time, and I would need access to it in any of my routes. So a route would say "give me the next widget"
      • Does that sound like an object I create in an initializer and tell it to inject into any route?
      • abuiles
        samselik_: then doesn't sound like a unit test
      • Grapho
        highcup: that sounds legit
      • samselik_
        abuiles: hm. it's a validated-input, so i want to test that, if user enters "123", it works, if they enter "abc", it doesnt
      • ZiggyTheHamster
        highcup: use dependency injection and a controller that ensures it has a single reference and that the controller is an injected singleton
      • samselik_
        (and by 'it works' i mean, updates a binding)
      • tubbo has quit
      • abuiles
        is that a component?
      • samselik_
        {{validated-input value=40}}. render. user enters 'abc' then focuses out. value is still 40.
      • ZiggyTheHamster
        so yeah, what you said :)
      • highcup
        Grapho: and if the object I have in my initializer abstracts network calls to update, does that begin to sound fishy? Or does it still sound right?
      • samselik_
        {{validated-input value=40}}. render. user enters '80' then focuses out. value is now 80
      • that sort of thing
      • Grapho
        highcup: a service could use ajax if it wants
      • ZiggyTheHamster
        samselik_: I do something like {{validated-input value=attrName object=thing property="attrName"}}
      • Grapho
        or websocket even
      • highcup
        ZiggyTheHamster: if you use a controller for a singleton, do you have to tell it to render on some part of your page for it to work?
      • ZiggyTheHamster
        then the _controller_ does the validation and makes its results available under thing.errors.attrName
      • highcup: negative
      • gannetson has quit
      • TeknoFiend has quit
      • highcup: actually I think you probably CAN'T have it render if you inject it via initializers, or if you do, it'll be {{render "thing"}} in one place. but it sounds like you don't want that, you just want to be able to get a model and some model-based data
      • highcup
        Right
      • I'm checking out ember services first -- have not used those yet.
      • Thanks Grapho, ZiggyTheHamster
      • Grapho
        imho service is better used for accessing and manipulating data that can be used anywhere. controllers, while they could be used a route, are better for displaying data to a template
      • mattkrea_ joined the channel
      • darrin joined the channel
      • TeknoFiend joined the channel
      • highcup
        Grapho: Gotcha. Yeah, the data I want to pass around won't ever be displayed to the user, but will influence my routes. It's almost like a global setting.
      • So sounds like a service is the way to go.
      • pereira_alex joined the channel
      • pereira_alex has quit
      • pereira_alex joined the channel
      • gavacho joined the channel
      • bkaney joined the channel
      • kamalaknn has quit
      • bantic joined the channel
      • sandstrom joined the channel
      • darrin has quit
      • digitalpixelpro has quit
      • cibernox has quit
      • blicero has quit
      • tyleri has quit
      • consideRatio joined the channel
      • consideRatio joined the channel
      • munumnu joined the channel
      • munumnu has quit