ember-cli

How to hide a section in .hbs and .js while taking an ember production build

吃可爱长大的小学妹 提交于 2021-02-11 15:21:01
问题 Our Ember application is developed in 2.8 version and we follow POD structure. We are generating two different builds as below 1) For our dev server : No change in code,just do build 2) For our test server: Delete a section in HBS and also remove a route from router.js then do build And we take build using " npm run-scripts build " which is configured in our package.json as below "scripts": { "build": "ember build", "start": "ember server", "test" : "ember test" }, I would like to know in

How to hide a section in .hbs and .js while taking an ember production build

▼魔方 西西 提交于 2021-02-11 15:16:21
问题 Our Ember application is developed in 2.8 version and we follow POD structure. We are generating two different builds as below 1) For our dev server : No change in code,just do build 2) For our test server: Delete a section in HBS and also remove a route from router.js then do build And we take build using " npm run-scripts build " which is configured in our package.json as below "scripts": { "build": "ember build", "start": "ember server", "test" : "ember test" }, I would like to know in

Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: name

泪湿孤枕 提交于 2021-01-04 04:27:29
问题 I randomly started getting this error Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: name on my app using ember-cli. I have only two routes Router.map(function() { this.route('buy'); this.route('rent'); }); no controllers, my index route redirects me to buy redirect: function() { this.transitionTo('buy'); } and my rent route also renders the buy template renderTemplate: function() { this.render('buy'); } I don't have a rent or index template. I have

Embedded ember-cli project conflicts with RequireJS

浪子不回头ぞ 提交于 2020-02-20 09:22:10
问题 I'm trying to embed an EmberJS application into a large portal application which uses extensively the RequireJS library. I'm using ember-cli to build the project. The built application consists of two files, dist/assets/vendor.js and dist/assets/myapp.js . The EmberJS application works after embedding it but the portal app's javascript breaks. After some research I've found out the problem is that vendor.js defines its own variables require , requirejs , requireModule and define which

Ember js - Cannot generate URL with dynamic segments using urlFor method

橙三吉。 提交于 2020-02-05 14:56:16
问题 I am able to generate a URL using urlFor() when I’m in the route /1/1/orders . but I’m unable to generate a URL in the application route. So this code is not working: var routeName = "scope.purchase.invoice"; var dynamicSegments = { scopeId: 1, scopeData: 2, invoiceId: 3, pageSize: 20, pageIndex: 1 }; var url = this.router.urlFor(routeName, 1, 2, 3, 10, 1); console.log("inside generated url", url); For this router.js : this.route("scope", { path: '/:scopeId/:scopeData' }, function(){ this

Ember js - Cannot generate URL with dynamic segments using urlFor method

不打扰是莪最后的温柔 提交于 2020-02-05 14:55:27
问题 I am able to generate a URL using urlFor() when I’m in the route /1/1/orders . but I’m unable to generate a URL in the application route. So this code is not working: var routeName = "scope.purchase.invoice"; var dynamicSegments = { scopeId: 1, scopeData: 2, invoiceId: 3, pageSize: 20, pageIndex: 1 }; var url = this.router.urlFor(routeName, 1, 2, 3, 10, 1); console.log("inside generated url", url); For this router.js : this.route("scope", { path: '/:scopeId/:scopeData' }, function(){ this

Cannot read property 'determineRelationshipType' when trying to save() Model with hasMany Relationship

三世轮回 提交于 2020-02-03 10:41:26
问题 I'm running into a tough bug when trying to save a record with the LocalStorage Adapter that has a hasMany relationship (Using Ember CLI). What I'm trying to do is save a product to a bag when a user clicks on a "Add to Bag" button. I'm getting this error in my console: Uncaught TypeError: Cannot read property 'determineRelationshipType' of undefined Product Model: import DS from 'ember-data'; export default DS.Model.extend({ ... bag: DS.belongsTo('bag') }); Bag Model: import DS from 'ember