Last active
August 29, 2015 14:06
-
-
Save stravid/a3a56d8eadc6251c0be9 to your computer and use it in GitHub Desktop.
Creating a Datepicker Ember Addon
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
// blueprints/ember-pikaday/index.js | |
module.exports = { | |
normalizeEntityName: function() {}, | |
afterInstall: function() { | |
var that = this; | |
return this.addBowerPackageToProject('pikaday').then(function() { | |
return that.addBowerPackageToProject('momentjs'); | |
}); | |
} | |
}; |
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
// Rest of the file | |
app.import('bower_components/momentjs/moment.js'); | |
app.import('bower_components/pikaday/pikaday.js'); | |
app.import('bower_components/pikaday/css/pikaday.css'); | |
module.exports = app.toTree(); |
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
// app/components/pikaday-input.js | |
import Ember from 'ember'; | |
import PikadayInputComponent from 'ember-pikaday/components/pikaday-input'; | |
export default PikadayInputComponent; |
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
ember addon ember-pikaday | |
cd ember-pikaday | |
bower install --save-dev pikaday | |
bower install --save-dev momentjs |
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
module.exports = { | |
name: 'ember-pikaday', | |
included: function(app) { | |
this._super.included(app); | |
app.import('bower_components/momentjs/moment.js'); | |
app.import('bower_components/pikaday/pikaday.js'); | |
app.import('bower_components/pikaday/css/pikaday.css'); | |
} | |
}; |
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
npm version 0.0.1 | |
git push origin master | |
git push origin --tags | |
npm publish |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment