Skip to content

Commit

Permalink
Trakttv controller that updates the viewvalue of the form element the…
Browse files Browse the repository at this point in the history
… proper way re #27
  • Loading branch information
SchizoDuckie committed Jul 5, 2014
1 parent 3f1f0bd commit 7f2f162
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions js/controllers/TraktTVCtrl.js
@@ -0,0 +1,18 @@
angular.module('DuckieTV.controllers.trakttv', [])

.controller('TraktTVCtrl', function($scope, $rootScope, TraktTV, FavoritesService) {

$scope.credentials = {
username: 'schizoduckie',
password: null,
passwordHash: null
}

$scope.encryptPassword = function() {
if ($scope.credentials.password !== null) {
$scope.credentials.passwordHash = CryptoJS.SHA1($scope.credentials.password).toString();
$scope.credentials.password = angular.copy($scope.credentials.passwordHash);
}
}

});

0 comments on commit 7f2f162

Please sign in to comment.