ember.js

How to use a favicon with ember-cli?

痞子三分冷 提交于 2019-12-23 07:12:47
问题 I had a favicon working for a while on my index template, but not any any other template, and now even my index template won't show it. I'm just in development, so I'm using ember server . index.html <link rel="icon" href="favicon.ico"> Just throwing around my favicon to see if it shows up anywhere, I now have it in the following locations: app/ public/ public/assets I think this should be very straightforward, especially since the index page doesn't change, just get's new stuff loaded into

emberjs bind data attributes

倖福魔咒の 提交于 2019-12-23 06:58:59
问题 I am wondering if there is a way to bind data attributes in a template when calling a view. For example (this doesn't work): {{ view App.SomeView data-dateBinding="currentDate" }} I have ended up doing it this way: <a {{bindAttr data-date="currentDate"}}></a> There must be a way to do it when calling the view? 回答1: You have to define in App.SomeView which attributes you want put in the HTML. App.SomeView = Ember.View.extend({ attributeBindings: ["data-date"] .... rest of view }) Now data

Accessing an Ember.Mixin within a custom handlebars helper

不打扰是莪最后的温柔 提交于 2019-12-23 06:05:05
问题 Is there an elegant way of using methods defined in an Ember.Mixin object within a custom handlebars helper? For example, in my case I have a mixin, App.Format which contains a bunch of different methods for formatting numbers, dates, ect and I would like to make some of these methods accessible directly from templates via custom helpers (e.g. {{formatNumber 450324}} ). The reason I don't just put the method implementation directly in the helper instead of the mixin is that I also need these

Accessing an Ember.Mixin within a custom handlebars helper

邮差的信 提交于 2019-12-23 06:04:17
问题 Is there an elegant way of using methods defined in an Ember.Mixin object within a custom handlebars helper? For example, in my case I have a mixin, App.Format which contains a bunch of different methods for formatting numbers, dates, ect and I would like to make some of these methods accessible directly from templates via custom helpers (e.g. {{formatNumber 450324}} ). The reason I don't just put the method implementation directly in the helper instead of the mixin is that I also need these

emberjs add class or id to the body tag

六月ゝ 毕业季﹏ 提交于 2019-12-23 05:27:26
问题 I have read this SO post on how to add tags with a class to a view i.e. :: App.ApplicationView = Ember.View.extend name: 'Home', layoutName: 'layouts/application', templateName: 'views/home' tagName: 'div' elementId: 'home' However, is there a way to adjust the application setup i.e. :: window.App = Ember.Application.create Store: DS.Store.extend revision: 10, adapter: DS.fixtureAdapter To configure a "class" or "id" attached to the body tag? Current Ember Setup: DEBUG: ----------------------

Want Ember.js named outlet to only display on click

杀马特。学长 韩版系。学妹 提交于 2019-12-23 04:55:11
问题 I have a subnav close to working properly thanks to the help of @intuitivepixel. The problem now is that when I load the root, the subnav is already displaying. The subnav should only be a part of the 'about' section -- the main nav is: about conditions programs testimonials On the index, the root of the app, these are the only links I would like displayed. But when you click 'about' I would like a subnav to display right below the main nav with 'about' set as active and the available sub

Format of data in PUT requests

早过忘川 提交于 2019-12-23 04:40:35
问题 I am preparing my server-side application to handle PUT requests comming from an emberjs client (using ember-data ). The client side application is not yet ready, so that I am not able to see the real requests (this in the hands of another developer). I nevertheless want to implement the server side. Where can I find information about the detailed format of PUT requests? I need two things: What is the emberjs application going to send in the URL , headers and body of the request? What is the

Allowing models to contain array of objects

穿精又带淫゛_ 提交于 2019-12-23 04:28:16
问题 Is it possible to have a model that contains an array of objects, without separating out those objects into having unique IDs? For example, I have a slide with multiple parameters that may come back from the API: slide: { "id": 1, "name": "stack-overflow-page", "type": "webpage" "parameters": [ {"key": "url", "value": "http://stackoverflow.com"}, {"key": "extension", "value": "/questions/ask"} ] } On my slide configuration page, I want to configure the slide and it's list of parameters. Since

ember handlebars: find which addon is defining a helper (Not present in app/helpers)

瘦欲@ 提交于 2019-12-23 04:28:13
问题 Having a hard time finding out where a helper not in app/helpers is defined. The helper was very generically named, I searched my package.json for the helper name but there was nothing. I was stuck hunting around with google to try and figure out what addon defined it. Given some helper ( {{totally-generic-name param1="foo"}} ) how would one go about finding where it's defined? (I happen to be on Ember 2.13) (Note: the helper was contains defined in ember-composable-helpers , so it would have

Ember.js {{render}} helper model not correctly set

不羁的心 提交于 2019-12-23 04:14:14
问题 I ran in a strange issue. I have an Article template. Within the article template I call a {{render "category/new" category}} . However when saving the new Category trough an action the wrong model is used. When I change it to {{render "category/new" this}} it uses the Article model. When I leave the model part empty it does also not work. The Template : <script type="text/x-handlebars" data-template-name="article"> ((...)) {{render "category/new" category}} // calls the popup for adding a