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

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

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




        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 03:08

    This should work.

    app = angular.module('plunker', [])
    
    app.controller 'MainCtrl', ($scope) ->
      $scope.users = ['bob', 'sean', 'rocky', 'john']
      $scope.test = ->
        console.log $scope.users
    

    HTML:

    
    
    

    Example plunk here

提交回复
热议问题