<!DOCTYPE html> <html lang="en" ng-app="myModule"> <head> <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/> <link rel="stylesheet" type="text/css" href="css/bootstrap.css" /> </head> <body ng-controller="myController"> <nav class="navbar navbar-default"> <div class="containet-fluid"> </div> </nav> <div class="col-md-6 well"> <hr style="border-top:1px dotted #ccc;"/> <div class="col-md-4"> <form> <div class = "form-group"> <input type = "text" class = "form-control" ng-model = "newList.list"/> </div> </form> </div> <div class="col-md-8"> <div class="form-inline"> <select class="form-control" > </select> </div> </div> </div> </body> </html>
var app = angular.module("myModule", []) .controller("myController", function($scope){ $scope.newList = {}; $scope.options = []; $scope.saveMember = function(){ $scope.options.push($scope.newList); $scope.newList = {}; }; });