Created
November 24, 2015 15:06
-
-
Save pfulton/5aeb32abcb622bf1f8fe to your computer and use it in GitHub Desktop.
Limiting results from a "local" JSON file in Ember. In my 2.5 weeks of fast Ember learning, I found a quick and (probably) dirty way to limit results from this JSON file that I'm working with.
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
// route | |
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function() { | |
return $.getJSON('data/questions.json').then(function(data) { | |
return data.questions.slice(0,3); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment