December 23, 2019, 3:19 pm
↧
December 24, 2019, 6:02 am
↧
↧
December 25, 2019, 12:32 am
@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
↧
December 25, 2019, 9:18 am
↧
December 25, 2019, 1:45 pm
@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
↧
↧
December 26, 2019, 6:31 am
↧
December 26, 2019, 8:01 am
@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
↧
December 26, 2019, 6:05 pm
@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
↧
December 26, 2019, 7:56 pm
@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
↧
↧
December 27, 2019, 9:17 am
↧
December 28, 2019, 4:15 pm
↧
December 28, 2019, 10:54 pm
↧
December 29, 2019, 11:22 am
↧
↧
December 30, 2019, 8:11 am
@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
↧
December 30, 2019, 2:59 pm
↧
December 30, 2019, 5:42 pm
@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
↧
December 30, 2019, 6:24 pm
@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
↧
↧
December 31, 2019, 2:34 pm
↧
@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
↧
↧