Skip to content

Instantly share code, notes, and snippets.

View Sch3lp's full-sized avatar
🐚

Tim Schraepen Sch3lp

🐚
View GitHub Profile
@Sch3lp
Sch3lp / app.js
Last active December 25, 2015 10:39
The twitchServices module has a method that allows a caller to get all the Streams. The service uses Angulars Promises: $q.defer(); The thing that I got stuck on was the $rootScope.$apply() wrapper block. If you don't do this then Angular's models won't be updated automagically. Another caveat was the fact that Twitch.SDK's 'streams' method retu…
'use strict';
angular.module('twitchSmartTvApp', ['twitchServices'])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'main.html',
controller: function ($scope, Streams) {
$scope.streams = Streams.getAll();
}