Shell w/ Angular Material (v1.1.0)
Created
February 20, 2017 13:04
-
-
Save CBenni/80db7b50df4a31563b69f2f59e024592 to your computer and use it in GitHub Desktop.
Blank Pen (External JS/CSS)
This file contains 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
<body layout="row" ng-app="myApp" ng-cloak> | |
</body> |
This file contains 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',['ngMaterial']) | |
.controller("c", function($scope) { | |
$scope.client_id = "m4fyzznv5j844d8q3plttncoxm2px6"; | |
$scope.redirect_uri = "https://cbenni.com/oauthgen/redirect"; | |
$scope.scopes = ["user_read","user_blocks_edit","user_blocks_read","user_follows_edit","channel_read","channel_editor","channel_commercial","channel_stream","channel_subscriptions","user_subscriptions","channel_check_subscription","chat_login","channel_feed_read","channel_feed_edit"] | |
$scope.selectedscopes = {}; | |
$scope.getAuthUrl = function(){ | |
var selscopes = []; | |
for(var i=0;i<$scope.scopes.length;++i) { | |
if($scope.selectedscopes[$scope.scopes[i]]) selscopes.push($scope.scopes[i]); | |
} | |
return "https://api.twitch.tv/kraken/oauth2/authorize" | |
+"?response_type=token" | |
+"&client_id="+$scope.client_id | |
+"&redirect_uri="+encodeURIComponent($scope.redirect_uri) | |
+"&scope="+selscopes.join("+"); | |
} | |
}); |
This file contains 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
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-aria.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular-animate.js"></script> | |
<script src="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.js"></script> |
This file contains 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
<link href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment