ember.js

Emberjs: Jquery Function not being called after Handlebars Template is loaded

落爺英雄遲暮 提交于 2019-12-25 16:31:42
问题 I have an EmberJS application where I'm trying to call a jquery function that positions some div elements on a page using .css() for a specific handlebars template. My problem is that when EmberJS loads in the template to my application (whether by url change, or {{linkTo}} , the jquery functions don't get fired. That said, if I refresh the page, they fire just fine and everything is great. Additionally, I have an event listener for if the page changes width, which will cause the function to

how to pass value ember view to controller

喜你入骨 提交于 2019-12-25 15:16:07
问题 I am new in pretty ember js development . I have done view below code {{view "select" content=model prompt="Please select a name" selectionBinding="" optionValuePath="content.body" optionLabelPath="content.title"}} using following Json posts = [{ title: "Raja", body: "There are lots of à la carte software environments in this world." }, { title: "Broken Promises", body: "James Coglan wrote a lengthy article about Promises in node.js." }]; and Router App.InRoute = Ember.Route.extend({ model:

can local or transient data be represented by URLs?

烂漫一生 提交于 2019-12-25 14:47:33
问题 A bit of a theoretical questions, although it comes from a real world problem when creating various objects in a single page app without immediately persisting them (see link below). My question is whether local or unpersisted data can have a URL. I think it can, because at the time the object is created (not necessarily persisted) it does exist and thus can be navigated to. So, entering the URL for it should display it as long as the data is there. Back and Fwd buttons should also work. If

Ember.js controller variables reseting after page refresh

浪尽此生 提交于 2019-12-25 14:40:03
问题 Using Ember.js: I have a Route App.QueryDataRoute = Ember.Route.extend({ model: function(params) { return Ember.RSVP.hash({ propertyObject: this.controllerFor("cres").get("properties").findBy('title', params.propertytype_title), nrOfOffers: this.controllerFor("queryData").get("nrOfOffers"), deal: this.controllerFor("queryData").get("deal"), price: this.controllerFor("queryData").get("price"), surface: this.controllerFor("queryData").get("surface"), }); } }); All those .get(' [variable name] '

Ember.js controller variables reseting after page refresh

时光毁灭记忆、已成空白 提交于 2019-12-25 14:39:54
问题 Using Ember.js: I have a Route App.QueryDataRoute = Ember.Route.extend({ model: function(params) { return Ember.RSVP.hash({ propertyObject: this.controllerFor("cres").get("properties").findBy('title', params.propertytype_title), nrOfOffers: this.controllerFor("queryData").get("nrOfOffers"), deal: this.controllerFor("queryData").get("deal"), price: this.controllerFor("queryData").get("price"), surface: this.controllerFor("queryData").get("surface"), }); } }); All those .get(' [variable name] '

Inverse relations not showing correctly sometimes

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 14:25:19
问题 I have two models, Issues and Users. Issues have two properties that belongs to User, owner and creator. When the issues/index.hbs template renders the issues, some owner and creator are correct, but others are missing, even when they are the same displayed before. For example, the creator Jhon (id 4) appears in some Issues but not in other issues, that have the same creator:4 Using the Ember inspector in Chrome, those users are correctly loaded, so they are there. Issue model: import DS from

Ember.Select view rendering performance

主宰稳场 提交于 2019-12-25 12:54:22
问题 I have an issue with Ember.Select views taking really long to render. Ember Inspector gives me rendering times of around 20-30ms for vanilla built in Ember.Select views (http://emberjs.com/guides/views/built-in-views/). That's fine with one or two Select fields but really adds up when you go beyond a few of them... Here is an example of a basic Select JS Bin: http://jsbin.com/xawak/10/. Are there any best practises to get around this? 回答1: Its an issue of the ember JS select component which

Ember.js and UIKIT

眉间皱痕 提交于 2019-12-25 11:53:12
问题 I try to add UIKIT to my Ember.js project how to do it? 1: bower install --save uikit All work fine on bower.json i don't know what to put on ember-cli-build.js e.g : app.import('bower_components/uikit/css/uikit.css'); How to do about js files? Thanks 回答1: you import js files same way as css files, if js files are in bower_components/uikit/js/uikit.js you do app.import('bower_components/uikit/js/uikit.js'); 来源: https://stackoverflow.com/questions/34465374/ember-js-and-uikit

Switch from Ember Data FixtureAdapter to Ember Model FixtureAdapter

你。 提交于 2019-12-25 10:51:05
问题 After I learned that the BasicAdapter in Ember Data has been removed, I decided to switch from Ember Data to Ember Model because the API I work with is not totally RESTful (and I need more flexibility in general). I'm wondering how to "translate" some parts of my code that used to work with the FixtureAdapter from Ember Data. Here for example, I get a list of profiles but I want to directly redirect to the first one. That means, accessing /profiles will redirect me to something like /profiles

A proper way to separate concerns?

丶灬走出姿态 提交于 2019-12-25 10:19:07
问题 My app allows the users to manage their documents. When creating one, a user has to either enter the document content manually or select a file from their computer (which would convert many formats to HTML for the user). Currently, I have a simple FileUploaderView which is basically an <input type="file"> that listens to file changes, and updates the value property of the view with an object like { file: { type: SOME_TYPE' }, content: SOME_CONTENT } . Then, DocumentsNewController listens to