Last active
April 14, 2020 15:20
-
-
Save jlami/39138ab576de35bb8b09dc8fc40ade45 to your computer and use it in GitHub Desktop.
ember-int-htmlattr-delay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
import {action} from '@ember/object'; | |
import { inject as service } from '@ember/service'; | |
export default class ApplicationController extends Controller { | |
appName = 'Ember Twiddle'; | |
@service intl; | |
date = new Date(); | |
constructor(...args) { | |
super(...args); | |
this.intl.on('localeChanged', () => { | |
if (this.intl.locale.includes('fr')) { | |
for (let i=0; i<10000; i++) | |
console.log('slow'); | |
} | |
}); | |
} | |
@action | |
testMe() { | |
console.log('action', [this.intl.locale.includes('fr') ? 'fr' : 'en']); | |
this.intl.setLocale([this.intl.locale.includes('fr') ? 'en' : 'fr']); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
div.date | |
{ | |
//background: blue; | |
display: inline-block; | |
} | |
[lang=fr] div.date { | |
background: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.17.0", | |
"EmberENV": { | |
"FEATURES": {}, | |
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false, | |
"_APPLICATION_TEMPLATE_WRAPPER": true, | |
"_JQUERY_INTEGRATION": true | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.17.0", | |
"ember-template-compiler": "3.17.0", | |
"ember-testing": "3.17.0" | |
}, | |
"addons": { | |
"@glimmer/component": "1.0.0", | |
"ember-intl": "4.3.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment