How to create an Array with AngularJS's ng-model

前端 未结 6 2055
感情败类
感情败类 2020-12-01 02:30

I\'m trying to create an array holding telephones, i have this code




        
6条回答
  •  暖寄归人
    2020-12-01 03:22

    It works fine for me: http://jsfiddle.net/qwertynl/htb9h/

    My javascript:

    var app = angular.module("myApp", [])
    app.controller("MyCtrl", ['$scope', function($scope) {
        $scope.telephone = []; // << remember to set this
    }]);
    

提交回复
热议问题