Sha256: 437d7e8a4ed773aa7fcefff43e5bd7af3bf0f035c62439e9be46695d06e5f06f

Contents?: true

Size: 734 Bytes

Versions: 12

Compression:

Stored size: 734 Bytes

Contents

angular.module 'paramsarray', []
angular.module('paramsarray').directive 'paramsarray', [
  '$filter'
  ($filter) ->

    link = (scope, element, attrs, ctrl) ->

      scope.parameter.values = []

      scope.addItem = ()->
        scope.parameter.values.push jQuery.extend(true, {}, scope.parameter.parameters)

    return {
      link: link
      restrict: 'A'
      require: 'ngModel'
      scope:
        parameter: '=ngModel'
      template: '' +
        '<div ng-repeat="value in parameter.values track by $index" style="border: 1px solid lightgray; margin: 1px 1px 1px 10px">' +
        '  <div params ng-model="value"></div>' +
        '</div>' +
        '<a class="btn btn-success btn-xs" ng-click="addItem()">+</a>'
    }
]

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
try_api-0.0.17 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.16 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.15 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.14 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.13 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.12 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.11 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.10 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.9 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.8 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.7 app/assets/javascripts/try_api/paramsarray.directive.js.coffee
try_api-0.0.6 app/assets/javascripts/try_api/paramsarray.directive.js.coffee