Sha256: 4cba8ed636d33a76191ae4ea59cbcc2632aaebc732ede7bad617c4a7c31aec71
Contents?: true
Size: 853 Bytes
Versions: 1
Compression:
Stored size: 853 Bytes
Contents
Sprangular.directive 'creditCardSelection', -> restrict: 'E' templateUrl: 'credit_cards/selection.html' scope: creditCard: '=' creditCards: '=' disabled: '=' submitted: '=' controller: ($scope) -> $scope.existingCreditCard = false $scope.$watch 'creditCards', (creditCards) -> return unless creditCards if creditCards.length > 0 found = _.find creditCards, (existing) -> existing.same($scope.creditCard) $scope.toggleExistingCreditCard() if found $scope.toggleExistingCreditCard = -> $scope.existingCreditCard = !$scope.existingCreditCard if $scope.existingCreditCard $scope.creditCard = $scope.creditCards[0] else $scope.creditCard = new Sprangular.CreditCard link: (element, attrs) -> attrs.disabled = false unless attrs.disabled?
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sprangular-0.1.0 | app/assets/javascripts/sprangular/directives/creditCardSelection.coffee |