Last active
December 11, 2019 10:01
-
-
Save runspired/b7ed2ada28015f6425ffe8894701a151 to your computer and use it in GitHub Desktop.
Named Blocks w/Defaults
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 Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: '' | |
}); |
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 Ember from 'ember'; | |
const InElementComponent = Ember.Component.extend({ | |
tagName: '', | |
}); | |
InElementComponent.reopenClass({ | |
positionalParams: ['target'] | |
}); | |
export default InElementComponent; | |
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 Ember from 'ember'; | |
const LetComponent = Ember.Component.extend({ | |
tagName: '', | |
}); | |
LetComponent.reopenClass({ | |
positionalParams: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] | |
}); | |
export default LetComponent; | |
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 Ember from 'ember'; | |
const NamedBlock = Ember.Component.extend({ | |
tagName: '', | |
didInsertElement() { | |
Ember.set(this.state, this.name, true); | |
}, | |
willDestroyElement() { | |
Ember.set(this.state, this.name, false); | |
} | |
}); | |
NamedBlock.reopenClass({ | |
positionalParams: ['state', 'name', 'target', 'defaultComponent'] | |
}); | |
export default NamedBlock; |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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 Ember from 'ember'; | |
export function hasChild([ref]/*, hash*/) { | |
return ref.childNodes.length > 0; | |
} | |
export default Ember.Helper.helper(hasChild); |
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 Ember from 'ember'; | |
export function ref(params/*, hash*/) { | |
return document.createElement(params[0]); | |
} | |
export default Ember.Helper.helper(ref); |
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.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"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": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment