ember-cli

ember-select-2 issue while using type-ahead with Ajax Queries

◇◆丶佛笑我妖孽 提交于 2019-12-02 14:35:52
问题 I'm using ember-select-2 as a typeahead in ember application.the problem is i can fetch the data from the server but the data isn't showing in dropdown.any help would be appreciated.Thanks in advance. {{select-2 placeholder="Choose from our many pizzas" value=chosenTypeaheadPizza typeaheadSearchingText="Searching pizzas" typeaheadNoMatchesText="No pizzas found for '%@'" typeaheadErrorText="Loading failed: %@" query="queryPizzas" }} and action handler is queryPizzas(query) { var self = this;

Insert Ember component at cursor in contentEditable element

江枫思渺然 提交于 2019-12-02 13:48:09
问题 I have a contentEditable div where I want to allow users to type text, as well as insert input elements such as text boxes and dropdowns. The elements will be inserted where the cursor currently is, by allowing the user to click a button outside the editable div. I got it working pretty well following this general example: http://jsfiddle.net/jwvha/1/ which basically does a document.selection.createRange().pasteHTML(html); The problem is that it expects HTML to be passed into the function

Setting up a controller property after the model hook

醉酒当歌 提交于 2019-12-02 13:38:18
问题 I need to set a controller property after the model hook. I can think of two ways to do this: model(params) { return this.store.findRecord('user', 1); }, afterModel(model, transition) { model.get('profile').then(profile => { this.set('profile', profile); }); }, setupController(controller, model) { controller.set('model', model); controller.set('profile', this.get('profile')); }, The other approach. i.e. skip setupController : model(params) { return this.store.findRecord('user', 1); },

Accessing Ember-CLI Nested Controllers

杀马特。学长 韩版系。学妹 提交于 2019-12-02 12:26:09
This is my directory structure: controllers/ ---- restaurant/ ----items.js ---- index.js ---- restaurant.js And my router declaration: this.route("restaurants",{ path: "/restaurants" }); this.resource("restaurant", { path: "/restaurants/:restaurant_id" }, function() { this.resource("items", { path: "/items" }); }); My Items controller (located in restaurants/items.js) begins with the following: export default Ember.ObjectController.extend({ needs: ["restaurant"], restaurant: Ember.computed.alias('controllers.restaurant.model') and is then followed by an action to add the item under hte

ember-cli (2.4.3) not generating DS models

空扰寡人 提交于 2019-12-02 11:43:45
问题 I am very surprised not to get DS models upon generating ember-cli model ember -v ember-cli: 2.4.3 node: 5.10.1 os: darwin x64 ember g model rental Then I get : // app/models/rentals import Model from 'ember-data/model'; export default Model.extend({ }); according to the ember guide , I should get : // app/models/rentals import DS from 'ember-data'; export default DS.Model.extend({ }); what could be wrong ? thanks for feedback 回答1: There is nothing wrong with the generated code :) Ember Data

ember-select-2 issue while using type-ahead with Ajax Queries

喜夏-厌秋 提交于 2019-12-02 09:10:16
I'm using ember-select-2 as a typeahead in ember application.the problem is i can fetch the data from the server but the data isn't showing in dropdown.any help would be appreciated.Thanks in advance. {{select-2 placeholder="Choose from our many pizzas" value=chosenTypeaheadPizza typeaheadSearchingText="Searching pizzas" typeaheadNoMatchesText="No pizzas found for '%@'" typeaheadErrorText="Loading failed: %@" query="queryPizzas" }} and action handler is queryPizzas(query) { var self = this; var store = self.get('store'); let adapter = store.adapterFor("pizzas"); let serachQuery = query.term;

How to render component/helper by name from instance field?

吃可爱长大的小学妹 提交于 2019-12-02 08:49:14
问题 Is there way to use component from controller/view field So instead of using {{contact-select label="Label:" contacts=form.prop}} // or {{input-field label="Label:" contacts=form.prop}} // or {{datepicker-component label="Label:" contacts=form.prop}} use some like {{context.helperName label="Label:" contacts=form.prop}} I try use ember-helpers-render-component but it doesn't take component name from property 回答1: You can use the component helper that was introduced in 1.11.0. Unfortunately

Ember CLI - Injecting a service

徘徊边缘 提交于 2019-12-02 08:48:12
问题 I created the following service and initializer using Ember CLI (generate blueprint): // services/session.js import Ember from 'ember'; export default Ember.Object.extend({ loggedIn: false, ... }); // initializers/session.js export default { name: 'session', initialize: function(container, app) { app.inject('route', 'session', 'service:session'); app.inject('controller', 'session', 'service:session'); } }; However, the session is undefined when attempting to access it in a route or controller

#ember-power-select: changing the value in one power-select box , it alternately changes the same value for another power-select box

只谈情不闲聊 提交于 2019-12-02 08:09:54
I used custom-search-action in #ember-power-select, changing the value in one power-select box , it alternately changes the value(sets the same value as selected in 1st select box)for another power-select box too. Below is the handlebar code: {{#each model.hpqualifications as |hpqualification|}} {{#power-select selected=hpqualification.hoprofile search=(action "hoProfile") onchange=(action (mut hpqualification.hoprofile.name) value="name") as |repo| }} {{repo.name}} {{/power-select}} {{/each}} The above code generated two select box since #each method has two data. Everything works fine. But

Ember-Simple-Auth currentUser example help required

旧街凉风 提交于 2019-12-02 07:54:07
问题 So I realize that the account example here: https://github.com/simplabs/ember-simple-auth/blob/8863c032fcea6148a5b3365be5d66dc2389d301d/examples/4-authenticated-account.html Provides the code for retrieving the currently logged in account. I just have a few questions about the example as I am trying to get it working in an Ember-CLI app. SimpleAuth is being used in the example however, I don't know where it's coming from as I am trying to import SimpleAuth from ... but I don't know what file