Textarea inside a SlideBox


#1

Hello guys,

I have a form with a textarea inside a slide box but I can’t manage to bind a model to the textarea.
The content of the textarea is empty after initializing in my controller and still empty when submitting the form.

The code works fine outside of a slidebox.
I think this is a scoping issue, as AngularJs replaces the textarea with its own directive, having its own scope (need to bind the model with $parent).

My template:

<ion-slide-box>
  <ion-slide>
    <form ng-submit="submitFeedback()">
      <textarea ng-model="$parent.feedback"></textarea>
      <button class="button button-block button-calm" type="submit">Send</button>
    </form>
  </ion-slide>
<ion-slide-box>

My controller:

.controller('PlaylistCtrl', function($scope, $stateParams) {
  $scope.feedback = 'toto';

  $scope.submitFeedback = function() {
    alert('feedback: ' + $scope.feedback);
  };
})

Link to the plunker demonstrating the issue: http://plnkr.co/edit/8KaXMo?p=preview

Any idea how to make this work in a SlideBox ?

Thanks guys!