Skip to content

Instantly share code, notes, and snippets.

@aldesantis
Created February 6, 2015 18:47
Show Gist options
  • Save aldesantis/2e9f30aaf906e7c14caf to your computer and use it in GitHub Desktop.
Save aldesantis/2e9f30aaf906e7c14caf to your computer and use it in GitHub Desktop.
angular.module('controllers', []).controller('SessionsController', ['$scope', '$translate',
($scope, $translate)->
$scope.labels = []
$translate(['models.user.labels.email', 'models.user.labels.password']).then(
(translations)->
$scope.foo = 'bar'
$scope.labels = translations['models.user.labels.email']
console.log 'promise resolved'
)
console.log $scope.test
$scope.loginFormSchema = {
type: 'object',
properties: {
email: {
type: 'string',
title: $scope.labels['models.user.labels.email']
},
password: {
type: 'string',
title: $scope.labels['models.user.labels.password'],
'x-schema-form': {
type: 'password'
}
}
},
required: ['email', 'password']
}
$scope.loginForm = [
'*',
{
type: 'submit',
title: 'Sign in',
style: 'btn btn-lg btn-primary'
}
]
$scope.login = {}
])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment