Quantcast
Channel: Ember.JS - Latest topics
Viewing all 4748 articles
Browse latest View live

Ember Fastboot / don't import node_modules Script

$
0
0

@MrChriZ wrote:

Can any one help with the below query:

It seems a very simple thing to want to do… but at present I’m none the wiser to how to funnel out a Node_Module script.

Thanks, Chris.

Posts: 1

Participants: 1

Read full topic


Ember pass values to another route

$
0
0

@SowmyaManohar wrote:

How will i pass a value to be used in another parameter from a service in transitionTo.

Actually, we use login-service and check for a specific condition and redirect them to forcepassword page, i just want to pass the id , so the user dont want to enter it again. is there any simple way?

Posts: 1

Participants: 1

Read full topic

I have no findRecord in the route, but Ember still find the record

$
0
0

@Nacho_B wrote:

Hi:

I have a CRUD to experiment and test things with my backend, and I have noticed something strange with this two nested routes:

  • clients/index hits the back end
  • clientes/show/:id do not (when following a link)

Maybe this happens because the only source of truth is the model already loaded in index. Is that true? If I reload the show page it does hit the backend.

I don’t like this behaviour too much, but now I have just discovered that in the show route… I have nothing!!

Is Ember Data magically creating the “return this.store.findRecord” action?

What I want now is to improve the call to manage errors with promises, but I don’t know where is that call to the back end.

I am a little bit lost with this magic :slight_smile:

Nacho B.

Posts: 1

Participants: 1

Read full topic

Best way to load a ton of JSON data into an Ember App

$
0
0

@jameshahn2 wrote:

Building a glossary app with 2000ish definitions. Roughly speaking, each definition includes:

url term speech_type (noun, verb etc) category definition see (cross references) antonyms synonyms img: src, caption

Knowing that, I have 2 questions:

  1. I see a similar topic from '14 that talks about Ember Data moving slow on large payloads. Is that still the case?
  2. How do you recommend deploying the data into production? I’m still pretty new in the Ember world and struggled with the Super-Rentals demo because the basic API is served through Ember Mirage… which is great until you try and deploy it. Does anyone have tips for working with the Amazon API Gateway?

Thanks y’all!

Posts: 2

Participants: 2

Read full topic

store.findAll keeps updating when model is added into store

$
0
0

@ondrejsevcik wrote:

Hi, I would like to load all data from the server, but then stop auto updating UI when user starts to edit some models. Currently with store.findAll it automatically pickups all newly created records. What’s the proper way to force that collections stop changing on updates?

Documentation states this

When creating a new record using any of the above methods Ember Data will update DS.RecordArrays such as those returned by store#peekAll() or store#findAll(). This means any data bindings or computed properties that depend on the RecordArray will automatically be synced to include the new or updated record values.

but there is no mention how to disable/workaround around this behaviour.

Thanks for help.

Posts: 1

Participants: 1

Read full topic

Ember Place Autocomplete not calling placeChangedCallback function

$
0
0

@yefan15 wrote:

I am running into the issue where when using ember place autocomplete search bar as a component it is not recognizing the placeChangedCallback function defined in the actions in my component. I am not sure what is going on.

Template:

<p id=“message”>Message: {{message}}</p>

<p>Full adddress from JSON sent to the callback: {{{fullAddress}}}</p>

<p>Clean string: {{cleanFullAddress}}</p>

<p> Model address: {{address}}</p>

<div id=“search-bar” data-google-auto="{{googleAuto}}">

<label class=“visually-hidden” for=“input-search”>Add a new address</label>

{{place-autocomplete-field

id=“input-search”

value= address

handlerController= this

placeholder=“Add a new address”

inputClass= ‘place-autocomplete–input’

placeChangedCallback= “addressChanged”

focusOutCallback=“done”

restrictions=googleMapsRestrictions

withGeoLocate= true

}}

<pre style=“font-size: 6px;”>

{{placeJSON}}

</pre>

Component:

googleMapsRestrictions: { country: ‘us’, }, fullAddress: null, googleAuto: null, action: { done(){ console.log(“Reached”); }, addressChanged(place) { console.log("***********"+place);

  }
}

Posts: 1

Participants: 1

Read full topic

Ember 3.4 and pluralize

$
0
0

@GELight wrote:

Hi there,

Feels very good to work with ember again. :slight_smile:

I have to migrate a v2.13 application to Ember v3.4. I generated a new app based on 3.4 and no I try to add all artifacts step by step.

I have 2 Questions so far:

  1. Where or in which package is the old pluralize() method placed?
  2. Where I have to place my adapter classes now?

This is my old adapter:

import Ember from 'ember';
import DS from 'ember-data';

export default DS.RESTAdapter.extend({
    
    urlForFindAll(modelName/*, snapshot*/) {
        let baseUrl = this.buildURL();
        return baseUrl + '/rest/' + Ember.String.pluralize(modelName) + '.json';
    },
    
    urlForFindRecord(id, modelName/*, snapshot*/) {
        let baseUrl = this.buildURL();
        return baseUrl + '/rest/' + Ember.String.pluralize(modelName) + '/' + id + '.json';
    }
    
});

Best regards, Mario

Posts: 5

Participants: 2

Read full topic

About - EmberJS Story Page

$
0
0

@ppcano wrote:

After a conversation about the EmberJS adoption, the ecosystem, and benefits, I found the Ember.js Wikipedia page describing very well the Ember philosophies and principles:

  • Focus on ambitious web applications

  • More productive out of the box

  • Stability without stagnation

  • Future web standards foresight

I have been using Ember for many years and I have experienced the reality and consistency of these principles over the time, while we get their benefits building and maintaining our SAAS product. But after evaluating the low Ember.js adoption even in some large apps in my location (Stockholm, Sweden), I wondered if the principles and benefits could not totally resonate to decision makers who finally select technologies based on other arguments like for example the lack of experienced developers (discussed in another topic ).

To help the communication of the Ember.js strengths, I propose creating the Ember.js Story Page:

The our story page is a commonly used to inform about the history behind a company, team or product; here a few examples: freshbooks, freshworks, airbnb, hyperloop, canva, instagram.

In the Ember.js case, the story page could show a timeline describing the different milestones the community has achieved and how the framework has evolved in its history. I think a visual representation of the past achievements helps to communicate some of the principles and benefits:

  • stability without stagnation

  • adoption for web standards.

  • vibrant contributors and community

  • rich ecosystem

  • mature and long-term project

  • ….

I am not sure if the proposal makes total sense, but I wanted to share the idea, so any feedback will be appreciated.

Related discussions

Posts: 1

Participants: 1

Read full topic


Ember-template-lint --fix?

$
0
0

@yohanmishkin wrote:

Ahoy!

ember-template-lint is wonderful.

Is there an easy or automated way to apply the linter’s recommended fixes, akin to eslint --fix by any chance?

Posts: 1

Participants: 1

Read full topic

Ember 3 on FF 38

$
0
0

@ahopkins wrote:

I am building an app that has a requirement that it needs to be compatible back to Firefox 38.

When I build and run it in this old version of FF, I get the following errors:

SyntaxError: class is a reserved identifier vendor.js:125836:0
ReferenceError: define is not defined matrix-frontend.js:5:0
TypeError: (intermediate value).extend is undefined

It seems that babel is not working right.

My ember-cli-build.js looks like this:

'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  let app = new EmberApp(defaults, {
    babel: {
      plugins: [
        'transform-object-rest-spread'
      ]
    },
    'ember-cli-babel': {
      includePolyfill: true
    }
  });

  return app.toTree();
};

Does anyone know how I can get polyfills for class and define working to be able to run 3.X on FF38?

Posts: 3

Participants: 2

Read full topic

Link to EmberTimes reader's question

Set query param value without encoding

$
0
0

@manoj wrote:

I’m using file path with some front slash in a query param. When the filepath value is changed, the front slashes are encoded to %2F. Example if filepath value is Project/File.hbs it is changed to Project%2FFile.hbs

Is there any way to display the filepath as it is without encoding.

Posts: 2

Participants: 2

Read full topic

Best/conventional way to document properties on ECMA classes?

$
0
0

@samselikoff wrote:

Let’s say I have a class:

/**
  The Mirage server.

  @class Server
  @public
*/
export default class Server {

  constructor(options = {}) {
    this.namespace = options.namespace '';
  }
  
}

What would be the best way to use JSDoc to document the namespace property?

One thought was to define a new getter:

export default class Server {

  constructor(options = {}) {
    this._namespace = options.namespace '';
  }

  /** 
    @property namespace
    @type String
    @public
  */
  get namespace() {
    return this._namespace;
  } 
}

Are there any other project doing this? Any established best practices or conventions?

Posts: 1

Participants: 1

Read full topic

Serve error - "this.pickFiles is not a function"

$
0
0

@Georgy_Dolganov wrote:

I’m trying to serve existing ember-app, but got stuck on this error message. this.pickFiles is not a function Tried to reinstall ember-cli, ember-cli-babel, node and etc, but it’s doesn’t make any impact.
Dk what to do

Posts: 1

Participants: 1

Read full topic

Constructor.name behaves differently in dev and prod builds for models defined with the ES6 class syntax

$
0
0

@bartocc wrote:

I’d like to understand why model.constructor.name is not available in prod builds while it works in dev and test envs for models defined with the ES6 class syntax.

I’ve setup a test app here: https://github.com/bartocc/model.constructor.name-prod-bug

To reproduce

  • git clone https://github.com/bartocc/model.constructor.name-prod-bug.git
  • cd model.constructor.name-prod-bug
  • ember serve
  • open http://localhost:4200

You should see:

model.constructor.name: ArticleModel
model.constructor.modelName: article

Now stop the server and start it again in prod env

  • ember serve --environment production
  • open http://localhost:4200

You should see something like this:

model.constructor.name: o
model.constructor.modelName: article

Why do we have such a different behaviour?

Posts: 4

Participants: 2

Read full topic


Afraid of becoming a components addict

$
0
0

@Nacho_B wrote:

Hi, in the last weeks I’ve mastered the art of component creation to a very high level. Such a level that I’ve become a dangerous developer :smiley: . I feel the urge to make components for everything.

The underlying truth is that components are very easy to manage, but my Ember experience is very short, so I’m not sure of what I am doing.

For example: I have a very big Product table, but i don’t want a gigantic Input/Edit page.

  • I want the “Show Product page” to be built using different pieces or modules, visually separated.

  • The Input/Edit forms are small modals that pop from each one of the “modules” in the main “Show Product page” (prices, multimedia, texts, comments, history, etc.)

OPTION1:

My initial approach (coming from a “procedural world”), was creating a big "Show Product template, with all the fields. My modules should be just visual pieces separated by HTML/CSS structures. The only components should be the modal forms to edit data.

OPTION2:

But now I am the master of components! I can also build my thematic modules as Ember components, with enclosed "show "and “edit” functions. The edit forms should be nested components inside each module. This way, the Product template will be just a clean and schematic container with calls to load components.

To follow the DDAU paradigm, the final “save” to persist data should be in the Product Controller, using clossures down to the nested forms. I think it’s easier if each module can save data, but I prefer playing by the common rules.

MY DOUBTS

Theese components will not be reused anywhere in the application. And reusing things is one of the main reasons for all the component theory. Thats what I’ve read, isn’t it? In this case, components are just an organizational tool.

When things go bigger, I do not know if my components addiction will be a problem somehow. For example, with the components directory growing and growing exponentially.

I like the idea of “ambitious web applications”, that’s why I’m here. :slight_smile: There is a lot to learn before that, but I am ambitious from day one, and I will greatly appreciate some real world advice until I can make my own decisions.

Regards: Nacho B.

Posts: 1

Participants: 1

Read full topic

Best Practices for List View to Detail View

$
0
0

@melriffe wrote:

I apologize for the general, simplistic Topic title. I really didn’t know how to boil down my inquiries into a single succinct title. But I am looking for the best way to accomplish what I’m about to describe. :slight_smile:

First, Ember is not my “native language”, as it were, so any guidance will be greatly appreciated. Additionally links to online resources will be super helpful.

Second, I’m trying to write an application that has 2 ways into an editor view: 1) via a “create new widget” button, and 2) via a list of widgets where a person can select one to load up the editor.

There is one caveat: the editor needs some data from an API to populate some drop-down lists.

What’s the best way for me to accomplish this?

Thanks, in advance!

Posts: 1

Participants: 1

Read full topic

My second order relazionships are not rendered by fastboot

$
0
0

@BenediktD wrote:

Hi,

In my app all second order relationships are not rendered by fastboot.For example: {{model.title}} renders fine but all deeper relationships for example {{model.user.name}} do not render via fastboot. Everything loads fine via the ember frontend. I‘m using ember data to load the model. Not sure why it renders differently on fastboot.

Posts: 2

Participants: 2

Read full topic

Need help with: Functions declared within loops referencing an outer scoped variable may lead to confusing semantics

$
0
0

@papakay19 wrote:

Please i have a controller with the code below.

import { computed } from '@ember/object';
import Controller from '@ember/controller';
import moment from 'moment';

export default Controller.extend({

  days: computed(function () {
    let before = moment().add(-8, 'days').format('YYYY-MM-DD');
    let after = moment().format('YYYY-MM-DD');
    let range = [];

    let itr = moment.twix(before, after).iterate("days");
    while (itr.hasNext()) {
      range.push(itr.next().format("ddd Do"));
    }

    return range;
  }),

  getDailySales: computed('model.sales.@each', function () {
    let before = moment().add(-8, 'days').format('YYYY-MM-DD');
    let after = moment().format('YYYY-MM-DD');
    let itr = moment.twix(before, after).iterate("days");

    let dailySales = [];

    while (itr.hasNext()) {
      let date = itr.next().format("YYYY-MM-DD");

      let day = moment(date).format('D');
      let thismonth = moment(date).format('M');
      let thisyear = moment(date).format('Y');

      let sum = 0;

      this.get('model.sales').filter(function (item) {
        if (item.get('day') === day && item.get('month') === thismonth && item.get('year') === thisyear) {
          item.get('items').forEach(function (saleItems) {
            if (saleItems.get('quantity_sold') && saleItems.get('selling_price')) {
              sum = parseInt(sum) + (parseInt(saleItems.get('selling_price')) * parseInt(saleItems.get('quantity_sold')));
            }
          });
        }
      });

      dailySales.push(sum);
    }

    return dailySales;
  })

});

Howevere on the line with this.get('model.sales').filter(function (item) { i get an error message that says Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (day, thismonth, thisyear, sum)

Please how can i fix this?

Posts: 1

Participants: 1

Read full topic

Deployed Ember to S3 - ember version is not changed

Viewing all 4748 articles
Browse latest View live




Latest Images