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
{ | |
"kind": "youtube#videoListResponse", | |
"etag": "\"DsOZ7qVJA4mxdTxZeNzis6uE6ck/9PT9LvCT4m7dStngSaVcA3wA4VE\"", | |
"pageInfo": { | |
"totalResults": 1, | |
"resultsPerPage": 1 | |
}, | |
"items": [ | |
{ |
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
@Directive({ | |
host: { | |
'(click)': 'goToRoute($event)', | |
'(keydown)': 'goToRoute($event)' | |
} | |
}) | |
class MyRouteHandler { | |
@Input() route; | |
constructor(private _router: Router) {} | |
goToRoute(evt: Event | KeyboardEvent) { |
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
vm.username = function($viewValue, $modelValue, scope) { | |
// check if username matches regex before validating | |
var value = $modelValue || $viewValue, deferred = $q.defer(); | |
if (UserConfig.ID_REGEX.test(value)) { | |
scope.options.templateOptions.loading = true; | |
UserService.username(value).then(function() { | |
deferred.reject(false); |
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
function matchPeople (list, idx) { | |
var randomNumber = Math.floor(Math.random() * list.length); | |
if (list[randomNumber] === list[idx]) { | |
return matchPeople(list, idx); | |
} | |
else { | |
idx++; | |
$scope.match.push(list[randomNumber]); | |
if (list.length === 1) { |
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
module.directive('react-grid', function () { | |
return { | |
scope: { props: '=' }, | |
link: function (scope, elem, attrs) { | |
var renderScheduled = false; | |
var component = React.createClass({ | |
/** @jsx React.DOM */ | |
var items = this.props.items; | |
var itemsDOM = items.map(function (item) { | |
var itemDOM = item.map(function (subItem) { |
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
if($scope.new_user_info.isLocation) | |
{ | |
if(!$scope.new_user_info.location_id) | |
{ | |
Location.create($scope.new_user_info.location).success(function(newLocation){ | |
$scope.new_user_info.location_id = newLocation.id; | |
$scope.new_location = {}; | |
successAddLocation = true; | |
}).error(function(data, status, header, config) { | |
if(status == 500) |
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
'use strict'; | |
printio.controller('ProductDetailsCtrl', function($scope, $routeParams, $filter, Printio) { | |
Printio.getProducts() | |
.then(fetchProduct) | |
.then(getShipEstimate) | |
.then(openProduct) | |
function fetchProduct(data) { |
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
app.factory('api', ['$http', '$q', '$log', function($http, $q, $log) { | |
return { | |
last: function(market, currency){ | |
$log.log('api/last', currency, 'market', market); | |
//return the promise directly. | |
return $http.get('/api/last/'+market+'/'+currency) | |
.then(function(result) { | |
//resolve the promise as the data | |
$log.log('api.last data', result.data); |
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
var app = angular.module('TradeList', [ | |
'ngAnimate' | |
, 'ngRoute' | |
], function( | |
$locationProvider | |
, $routeProvider | |
) { | |
$locationProvider.html5Mode(true); | |
$routeProvider.when('/', { | |
templateUrl: '/assets/views/orders.html' |
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
angular.module('myApp', []) | |
.provider('greeterProvider', function () { | |
var greeting = 'Hello!' | |
this.greeting = function (name) { | |
return 'Hello ' + name + '!'; | |
}); | |
function Greeter() { | |
this.greet = function () { | |
return greeting; |
NewerOlder