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

Ember.js - Countdown to The New Year - Ember Mapbox GL


Ember.js - Countdown to The New Year - Ember CLI TypeScript

How do add attributes to window in Ember

$
0
0

@SarathSantoshDamaraj wrote:

#1

I am using a plugin Dayjs, and want to be available like MomentJs in window scope – window.moment. I am manually adding it to window from a utils file.

//.../utils/dayjs.js
import dayjs from 'dayjs'
...
window.dayjs = dayjs;
...

Is there any better way to do the same from ember perspective ?

#2

and I also at some point in one of component.js files, appending script tag to the document.head. Considering the script content is from the same domain and secure.

//.../someComponent/component.js
...
appendScript() {
      var script = document.createElement('script');
      script.type = 'text/javascript';
      script.text = locale.content;
      script.text += `dayjs.locale('${locale}')`;
      document.head.appendChild(script);
}

Is there any other approach to accomplish this too ?

-TIA

Posts: 1

Participants: 1

Read full topic

Ember.js - Countdown to The New Year - Ember Template Invocation Location

Cannot access model with belongsTo relation

$
0
0

@danchann wrote:

Ember version: 3.10.2

After I changed the relation to belongsTo I get a proxy object. I have tried many different syntaxes to access it without success.

I originally had a model firstName: DS.attr(“string”), lastName: DS.attr(“string”), group: DS.attr()

then I changed group to group: DS.belongsTo("group-names")

in model/group-names I have name: DS.attr("string")

The reason that I made the change was that I’m trying to track the dirtyAttribute of the model with nested properties. This question was seen to come up a few times over the years.

Posts: 1

Participants: 1

Read full topic

Ember.js - Countdown to The New Year - Ember CLI Update

notifyPropertyChanged and native classes

$
0
0

@J_A_L wrote:

I used notifyPropertyChanged in a few Ember Objects. In the classes I have a property getter that makes an external third party API call and sometimes I want to at-will update that data. It works perfectly, but with the change to native classes it seems like EmberObject is sort of going to be eventually deprecated. Am I reading too much into this? Is there a more preferred design pattern.

For a real world example, suppose I display the outside temperature. There’s a button the user clicks to update the outside temperature. There’s no ready way to get the third party temperature service to set the value on the object. So, if I get the temperature from the third party API, and use notifyPropertyChanged on that property any templates etc that use that property rerender. The only other way I’ve seen it done is to wrap the rendered property in an if and then toggle the if conditional which seems really clunky.

Posts: 1

Participants: 1

Read full topic

Nested Array to Query Params

$
0
0

@wukongrita wrote:

Hi, I have:

[
    {
        id: // the field to be search
            {
                eq: '1234'  // eq is the operand; 1234 is the keyword
            }
    },
    {
        description:
            {
                like: 'desc'
            }
    }
]

How to transform it to query parameters to:

?filter[id][eq]=1234&filter[description][like]=desc

since the API needed the format like so for the filters?

Posts: 1

Participants: 1

Read full topic


Allow multiple app versions

$
0
0

@Henry wrote:

I’m developing an ember application that uses synchronized and versioned data from clients. To prevent clients to update instantly their data version every time a new release of the app is made, we decided to support a window of versions (let’s say the current app version and the previous two). We want to handle this version control automatically, so the user will only see that new features have been added when the data version has been updated; otherwise, they keep seeing the same app that they have been using before. To achieve this, we thought of separating the authentication process into a different application so, when a user logs in app.com, he or she is redirected to app.com/vX/dashboard, where vX is the version supported for that user’s data.

This approach works and makes easy the deployment process because when a new app version is released, we only need to add a new vX path for the deployed files and this keeps the previous versions still available on their own paths. But having the Auth process separate into a different app makes development and testing harder. The app makes also a heavy use of service workers so this can be challenging to handle when the users change from one version to another.

What’s your opinion about this? Is there a better way to handle this scenario? Am I missing unforeseen consequences of this that will make this solution a terrible choice? I will welcome any feedback you can provide me.

Posts: 1

Participants: 1

Read full topic

Ember.js - Countdown to The New Year - Ember In Viewport

Ember.js - Countdown to The New Year - Ember Changeset

Ember's Module system

$
0
0

@harimath wrote:

I am trying to grasp a basic understanding of Ember’s module system.

So specifically have 2 questions;

  1. Does it use the CommonJS module system OR the native ES2015 module system?

  2. Have there been any changes in that implementation over the course of different Ember versions. I saw this article on Module Unification https://blog.emberjs.com/2019/03/11/update-on-module-unification-and-octane.html What specifically is getting updated with this ?

Posts: 1

Participants: 1

Read full topic

Ember.js - Countdown to The New Year - Ember Code Snippet

Why ember-cli-update is failing?

$
0
0

@Yassine wrote:

ember-cli-update command is failing with this error: any ideas!

{ Error: Command failed: git clone --mirror https://github.com/ember-cli/ember-new-output /var/folders/zr/gt42wmv51g7ffz7n0dx9wfzc0000gp/T/tmp-24473KUOfMNXroFSq/.git
Cloning into bare repository '/var/folders/zr/gt42wmv51g7ffz7n0dx9wfzc0000gp/T/tmp-24473KUOfMNXroFSq/.git'...
Bad owner or permissions on /Users/yassiney./.ssh/config
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

    at ChildProcess.exithandler (child_process.js:294:12)
    at ChildProcess.emit (events.js:198:13)
    at maybeClose (internal/child_process.js:982:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
  killed: false,
  code: 128,
  signal: null,
  cmd:
   'git clone --mirror https://github.com/ember-cli/ember-new-output /var/folders/zr/gt42wmv51g7ffz7n0dx9wfzc0000gp/T/tmp-24473KUOfMNXroFSq/.git',
  stdout: '',
  stderr:
   'Cloning into bare repository \'/var/folders/zr/gt42wmv51g7ffz7n0dx9wfzc0000gp/T/tmp-24473KUOfMNXroFSq/.git\'...\nBad owner or permissions on /Users/yassiney./.ssh/config\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\n' }

Posts: 1

Participants: 1

Read full topic

Ember.js - Countdown to The New Year - Ember Exam


Uncaught (in promise) Error: Compile Error: Cannot find component button

$
0
0

@Yassine wrote:

One one has an idea what this error is for?! I tried everything but couldn’t figure it out (it occurred while trying to compile my app after upgrading it, I’m using the <Button element from the ember-elements library)

Uncaught (in promise) Error: Compile Error: Cannot find component button
    at opcode-compiler.js:152
    at Compilers.compile (opcode-compiler.js:44)
    at compile (opcode-compiler.js:740)
    at LazyCompiler.add (opcode-compiler.js:934)
    at CompilableProgram.compile (opcode-compiler.js:698)
    at OutletComponentManager.getLayout (index.js:4403)
    at Object.evaluate (runtime.js:1689)
    at AppendOpcodes.evaluate (runtime.js:73)
    at LowLevelVM.evaluateSyscall (runtime.js:3295)
    at LowLevelVM.evaluateInner (runtime.js:3241)
(anonymous) @ opcode-compiler.js:152
compile @ opcode-compiler.js:44
compile @ opcode-compiler.js:740
add @ opcode-compiler.js:934
compile @ opcode-compiler.js:698
getLayout @ index.js:4403
(anonymous) @ runtime.js:1689
evaluate @ runtime.js:73
evaluateSyscall @ runtime.js:3295
evaluateInner @ runtime.js:3241
evaluateOuter @ runtime.js:3233
next @ runtime.js:5299
next @ runtime.js:5335
RootState.render @ index.js:5550
runInAutotrackingTransaction @ index.js:1039
_renderRoots @ index.js:5848
_renderRootsTransaction @ index.js:5886
_renderRoot @ index.js:5806
_appendDefinition @ index.js:5721
appendOutletView @ index.js:5707
invoke @ backburner.js:340
flush @ backburner.js:229
flush @ backburner.js:426
_end @ backburner.js:960
Backburner._boundAutorunEnd @ backburner.js:629
Promise.then (async)
iterations @ backburner.js:28
flush @ index.js:53
_scheduleAutorun @ backburner.js:1179
_end @ backburner.js:970
Backburner._boundAutorunEnd @ backburner.js:629
Promise.then (async)
iterations @ backburner.js:28
flush @ index.js:53
_scheduleAutorun @ backburner.js:1179
_end @ backburner.js:970
Backburner._boundAutorunEnd @ backburner.js:629
Promise.then (async)
iterations @ backburner.js:28
flush @ index.js:53
_scheduleAutorun @ backburner.js:1179
_end @ backburner.js:970
Backburner._boundAutorunEnd @ backburner.js:629
Promise.then (async)
iterations @ backburner.js:28
flush @ index.js:53
_scheduleAutorun @ backburner.js:1179
_end @ backburner.js:970
Backburner._boundAutorunEnd @ backburner.js:629
Promise.then (async)
iterations @ backburner.js:28
flush @ index.js:53
_scheduleAutorun @ backburner.js:1179
_ensureInstance @ backburner.js:1167
schedule @ backburner.js:776
schedule @ index.js:372
waitForDOMReady @ application.js:442
init @ application.js:354
superWrapper @ index.js:423
initialize @ core_object.js:90
create @ core_object.js:681
(anonymous) @ app-boot.js:3

Posts: 1

Participants: 1

Read full topic

Testing component content

$
0
0

@bmurphy wrote:

Hi all,

I’m trying to get some basic Integration tests going for some of my components. Looking at the docs and other examples it would seem that generally you want to not make things too complicated for yourself and assert against the rendered text content, for example. That’s all fine for basic small examples but my component renders an entire table of content. Looking at the string output it would appear my tests would get kinda messy. What do others do when doing component content rendering tests?

Thanks!

Posts: 2

Participants: 2

Read full topic

Ember.js - Countdown to The New Year - Built-in Addons

Standalone use of core modules

$
0
0

@bumbu wrote:

I’m trying to use EmberObject and computed like in this tutorial in a non-ember project.

I installed (via NPM) ember-source, but trying to import ‘ember-source/dist/packages/@ember/object’ has issues as it can’t find other dependent modules (e.g. ‘@ember/-internals/metal’).

I’m using typescript (latest) and webpack (v3).

Is there a way to use EmberObject outside of ember setup?

Posts: 1

Participants: 1

Read full topic

Datetime picker

Viewing all 4838 articles
Browse latest View live