Eingang wird nicht klar, nach form der Einreichung in AngularJS mithilfe von Ionic framework

Ich habe dieses seltsame problem. Wenn ich deaktivieren Sie das Modell in den controller, das input-Feld gebunden sind, um das Modell mit ng-Modell nicht klar, wenn das Formular abgeschickt wird.

Controller

angular.module('starter.controllers', [])
.controller('DashCtrl', ["$scope", function($scope) {
    $scope.clearInput = function() {
      console.log("I get there...");
      //Here's the issue!!! It's not working as expected!
      $scope.message = "";
    };
}]);

Vorlage

<ion-view title="Dashboard">
    <ion-content class="padding">
        <form name="myform" ng-submit="clearInput()">
            <label class="item item-input">
                <input type="text" ng-model="message"/>
            </label>
            <button type="submit" class="button button-positive" >
                button-positive
            </button>
        </form>
    </ion-content>
</ion-view>

Bekomme ich die Ausgabe in der Konsole "ich bekomme es", so wird die Funktion aktiviert wird. Was vermisse ich hier?

InformationsquelleAutor Felix D. | 2014-11-20

Schreibe einen Kommentar