This file contains hidden or 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
| /* Controls width of the widget */ | |
| .badge-container {width:700px; margin: 0 auto;} | |
| /* Makes Badges display inline */ | |
| #badges li { display: inline;} | |
| /* Controls badges row offset */ | |
| #badges li:nth-child(20n+11) {margin-left:30px;} | |
| /* Controls badges size and alignment */ |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Component.extend({ | |
| }); |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| routes: [ | |
| '0', | |
| '1', | |
| '2', | |
| '3', | |
| '4', |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| aPropertyThatsFalsey: 'NOT_CTA_BOTTOM', | |
| aPropertyThatsTruthy: 'CTA_BOTTOM', | |
| init() { | |
| this._super(...arguments); |
This file contains hidden or 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 Ember from 'ember'; | |
| export default Ember.Controller.extend({ | |
| appName: 'Ember Twiddle', | |
| ascendingSort: ['shit:asc'], | |
| randomSort: ['shit:fufdiosudf'], | |
| descendingSort: ['shit:desc'], | |
| defaultShit: ['shit'], | |
| shitToSort: [1,5,2,7,3,9,5,3,0,9,2,-1,100].map(shit => { | |
| return { shit }; |
This file contains hidden or 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
| // JavaScript Functional Destructure | |
| const hello = ({ first, last }) => `Hello ${first} ${last}!`; | |
| const person = { first: 'John', last: 'Doe' }; | |
| // outputs "Hello John Doe!" | |
| hello(person); |
This file contains hidden or 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
| const person = { first: 'John', last: 'Doe' }; | |
| /* -------------- TypeScript Function -------------- */ | |
| const hello1 = (first: string, last: string) => | |
| `Hello ${first} ${last}!`; | |
| // outputs "Hello John Doe!" | |
| hello1(person.first, person.last); | |
| /* -- Incorrect TypeScript Functional Destructure -- */ |
This file contains hidden or 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
| const person = { first: 'John', last: 'Doe' }; | |
| /* -- Correct TypeScript Functional Destructure -- */ | |
| // Define a 'Person' interface with the shape of | |
| // the expected Person object argument | |
| interface Person { | |
| first: string; | |
| last: string; | |
| } |
This file contains hidden or 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
| // a 'Person' object requires 'first' and 'last' | |
| // properties whose values are strings | |
| interface Person { | |
| first: string; | |
| last: string; | |
| } | |
| // This defines that the first functional argument | |
| // must be an Array of 'Person' objects, then destructs | |
| // the first person's first and last name properties |
This file contains hidden or 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
| interface GeoInterface { | |
| state: string; | |
| country: string; | |
| } | |
| interface PersonInterface { | |
| first: string; | |
| last: string; | |
| // a Person must contain a 'geo' object that matches | |
| // the defined GeoInterface structure |
OlderNewer