ember-cli

Where to add css and js files in ember-cli app?

痴心易碎 提交于 2019-12-24 02:16:16
问题 In rails, js files are located under app/assets/javascripts Similarly where to add js and css files in ember-cli app ? 回答1: app/styles/ should contain your stylesheets: Contains your stylesheets, whether SASS, LESS, Stylus, Compass, or plain CSS (though only one type is allowed, see Asset Compilation). These are all compiled into <app-name>.css If you need external JavaScript libraries, you should manage them in dependency sections of package.json and bower.json . You may have to include the

Use query params of parent route to refresh the model in subroute

梦想的初衷 提交于 2019-12-23 23:13:28
问题 I have a route main which has a query param search . I have subroutes main.sub1 , main.sub2 Going to /main/sub1?search=hello or /main/sub2?search=hello sets the query param of the main route to hello . This part works fine. Now I would like to be able to refresh the model of main.sub1 when the query param search in route main changes, so I here is the code of the route main.sub1 : export default Ember.Route.extend({ queryParams: { search: { refreshModel: true } }, model(params) { // here I

`SCRIPT` tags are not allowed in HTMLBars templates

无人久伴 提交于 2019-12-23 21:09:29
问题 Hi there and thank you for clicking my question. I have just upgraded my application to the latest ember-cli release ( 2.3.0-beta.1 ) and now one (or more) of my templates messed with the build. What coming next seems like a trivial issue, yet I never fully got around to it very well, so I'm finally asking. As the title suggests, I previously had <script> tags in my templates for minor things, such as a small jQuery conditional append() or anything doable by 2 or 3 lines of code. I never

How can I share a template between two components using Ember CLI?

浪子不回头ぞ 提交于 2019-12-23 19:24:47
问题 I have two components: SpecialButtonComponent and SpecialButtonDerivativeComponent . The SpecialButton component automatically uses the template found at /app/templates/components/special-button.hbs . I would like for SpecialButtonDerivativeComponent to use the same template, but so far I'm having no luck trying to go with this technique: // app/components/special-button-derivative.js import SpecialButtonComponent from './special-button'; export default SpecialButtonComponent.extend({

Self nested infinite routes in Ember.js

我的未来我决定 提交于 2019-12-23 17:01:09
问题 I would like to make a sort of directory structure with Ember.js. Here is an example of how an url can look like: folder/1/folder/44/document/3 As you can see a folder can have multiple folders inside but also documents. I'm wondering how I should handle something like this in my router because beforehand my application doesn't know if a folder has other folders inside or only documents. I think I need to make separated routes instead of nested routes: App.Router.map(function() { this.route(

Can't find module on migrating ember-cli app to TypeScript

爷,独闯天下 提交于 2019-12-23 16:35:48
问题 I want to try ts inside my ember project ( I try it before on small applications ) So i have "ember-cli-typify": "^0.3.1", "typescript": "^2.0.3" "typings": "^1.4.0" "ember-cli": "2.4.3" Inside my tsconfig.json { "compilerOptions": { "target": "ES6", "allowJs": true, "moduleResolution": "node", "noEmitOnError": true, "noEmit": true, "baseUrl": ".", "paths": { "ember": ["node_modules/at-types-ember"], "npm:*": ["local-types/*"], "*": ["local-types/*"] } }, "include": [ "app/**/*" ], "files": [

Proper way to access third party libs such as D3 in Ember CLI? [closed]

夙愿已清 提交于 2019-12-23 15:36:54
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Here is how I've done: bower install d3 --save then added to Broccoli.js : app.import('bower_components/d3/d3.js'); then in my view, added: import d3 from 'bower_components/d3/d3'; and attempted to use it. This causes an issue when launching the app. In devtools I see this error: Uncaught TypeError: Cannot read

using baseUrl affects the path to my assets

不羁的心 提交于 2019-12-23 15:24:56
问题 I'm integrating an ember-cli app inside my main site which will be accessible at url http://host/faq/....ember...routes So I added baseUrl: /faq/ to my ember config/environment.js module.exports = function(environment) { var ENV = { modulePrefix: 'faq', environment: environment, baseURL: '/faq/', locationType: 'hash', The problem : While developing in my ember-cli environment with ember server my assets such as ( SVG, FONTS and IMAGES ) are giving me a NOT FOUND now. For example : http://host

Block helper with ember-cli

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 13:07:58
问题 I'm trying to make a simple block helper but can't find any documentation for ember-cli on the subject UPDATED Here's the helper: import Ember from 'ember'; export default function uiInput(options) { return new Handlebars.SafeString( '<div class="ui input">' + options.fn(this) + '</div>'); } And in the template: {{#ui-input}} TEST {{/ui-input}} And the output should be: <div class="ui input"> TEST </div> But the output I'm getting is: TEST <div class="ui input"> undefined </div> What am I

Ember JS Please load `ember-template-compiler.js` prior to calling `compile`

拟墨画扇 提交于 2019-12-23 09:50:01
问题 I am still getting the error below despite having following the instructions on this link Ember.js: HtmlBars and the Handlebars.compile command. Below I have copied and pasted my package.json,bower.json and brocfile.js. Not sure what is causing the issue. Uncaught Error: Cannot call compile without the template compiler loaded. Please load ember-template-compiler.js prior to calling compile . package.json { "name": "ui", "version": "0.0.0", "description": "Small description for ui goes here",