Skip to content

Instantly share code, notes, and snippets.

View nareeboy's full-sized avatar

Naresh Shan nareeboy

View GitHub Profile
@nareeboy
nareeboy / gist:10428091
Created April 10, 2014 22:11
Angular - JSON call script
var myAppTest = angular.module('myAppTest' , []);
myAppTest.controller('MyController' , ['$scope' , '$http', function ($scope , $http){
$http.get('js/data.json').success(function(data){
$scope.artists = data;
$scope.artistOrder = 'name';
})
}]);
@nareeboy
nareeboy / gist:10428139
Created April 10, 2014 22:12
Angular - simple data sorter
<div class="main" ng-controller="MyController">
<div class="search">
<h1>Artist Search</h1>
<label for="">search</label>
<input ng-model="query" placeholder="search for artist" autofocus>
<label class="formgroup">By:
<select ng-model="artistOrder">
<option value="name">Name</option>
<option value="reknown">reknown</option>