mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 15:07:13 +08:00
Toderp shit and Angular 1.2.0rc2
This commit is contained in:
26
example/twitter/app.js
Normal file
26
example/twitter/app.js
Normal file
@ -0,0 +1,26 @@
|
||||
angular.module('ionic.twitter', ['ngTouch', 'ngResource'])
|
||||
|
||||
.factory('TweetSearcher', function($resource) {
|
||||
var searchResource = $resource('http://search.twitter.com/:action', {
|
||||
action: 'search.json',
|
||||
callback:'JSON_CALLBACK'
|
||||
}, {
|
||||
get: {
|
||||
method:'JSONP'
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
search: function(query) {
|
||||
return searchResource.query({
|
||||
q: 'Cats'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
.controller('SearchCtrl', function($scope, TweetSearcher) {
|
||||
$scope.search = function(query) {
|
||||
TweetSearcher.search(query);
|
||||
};
|
||||
});
|
||||
Reference in New Issue
Block a user