Last active
April 4, 2018 13:41
-
-
Save gdgupta11/ad42649ccee4175f2e3aca1fad50cf25 to your computer and use it in GitHub Desktop.
basic_component_positional_parms
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({ | |
name: Ember.computed('params.[]', function(){ | |
return this.get('params')[0]; | |
}), | |
id:Ember.computed('params.[]', function(){ | |
return this.get('params')[2]; | |
}), | |
location:Ember.computed('params.[]', function(){ | |
return this.get('params')[1]; | |
}), | |
}).reopenClass({ | |
positionalParams: 'params' | |
}); |
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'; | |
import config from './config/environment'; | |
const Router = Ember.Router.extend({ | |
location: 'none', | |
rootURL: config.rootURL | |
}); | |
Router.map(function() { | |
}); | |
export default Router; | |
// just a sample application showing the usage of static model data in components by passing positional parameters. |
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.Route.extend({ | |
model(){ | |
return [ | |
{ | |
name:"Gaurav Gupta", | |
id: "1", | |
location: "Bangalore" | |
}, | |
{ | |
name:"Priyanka Gupta", | |
id: "2", | |
location: "Mumbai" | |
}, | |
{ | |
name:"Garima Gupta", | |
id: "3", | |
location: "Burhanpur" | |
} | |
] | |
} | |
}); |
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.Route.extend({ | |
}); |
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.13.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.16.2", | |
"ember-template-compiler": "2.16.2", | |
"ember-testing": "2.16.2" | |
}, | |
"addons": { | |
"ember-data": "2.16.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment