Skip to content

Instantly share code, notes, and snippets.

@thiagosbrito
Created May 1, 2014 18:08
Show Gist options
  • Save thiagosbrito/f3663b234fe38428310d to your computer and use it in GitHub Desktop.
Save thiagosbrito/f3663b234fe38428310d to your computer and use it in GitHub Desktop.
// acao que deveria inserir o pedaco do dom no form
$scope.newField = (element) ->
element = $('#newFundamentalCause').children()
$scope.formCausa.push(element)
// botao que adiciona o campo chamando a funcao newField()
<button type="button" class="btn btn-primary pull-right" ng-click="newField()"><i class="fa fa-file"></i> {{'actions.NOVO' | translate}} </button>
// ####
// ####
// form que deve receber o dom
<form id="newFundamentalCause" role="form">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="form-group">
<label for="porque1">{{'desvios.PORQUELABEL' | translate}}</label>
<textarea id="porque1" ng-model="formCausa.descrPorque1" class="form-control" rows="3" ng-trim="false" maxlength="4000"></textarea>
<p class="help-block ">{{4000 - formCausa.descrPorque1.length}} caracteres restantes</p>
</div>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment