Skip to content

Instantly share code, notes, and snippets.

@abhilashlr
Created March 18, 2020 03:01
Show Gist options
  • Save abhilashlr/e8fe9708d6bacb2cc9ffce6ff8007367 to your computer and use it in GitHub Desktop.
Save abhilashlr/e8fe9708d6bacb2cc9ffce6ff8007367 to your computer and use it in GitHub Desktop.
Whitespace
import Controller from '@ember/controller';
export default Controller.extend({
});
import { helper } from '@ember/component/helper';
export default helper(function t(params/*, hash*/) {
return params;
});
<h1>White space</h1>
<style type="text/css">
.inline-block {
display: inline-block;
vertical-align:middle;
}
.icon-alert {
border: solid 1px;
width: 16px;
height: 16px;
display: inline-block;
}
.margin-right-20 {
margin-right: 20px;
}
</style>
<div class="inline-block">
<i class="icon-alert margin-right-20"></i>
{{#if condition1}}
{{t "something_from_server1"}}
{{else if condition2}}
{{t "something_from_3rd_party_uncontrollable_key"}}
{{else}}
{{t "generic_message"}}
{{/if}}
</div>
<br>
<div class="inline-block">
<i class="icon-alert margin-right-20"></i>
{{~#if condition1}}
{{t "something_from_server1"}}
{{~else if condition2}}
{{t "something_from_3rd_party_uncontrollable_key"}}
{{~else}}
{{~t "generic_message"}}
{{/if}}
</div>
{
"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.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"@glimmer/component": "1.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment