<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>日考15-实现输入内容渲染页面</title> <script src="angular1.4.6.min.js"></script> <script> var app=angular.module("myApp",[]); app.controller("myController",function($scope){ $scope.ullist=["132","456"]; $scope.bc=function(){ var a=$scope.asd; $scope.ullist.unshift(a) } }) </script> </head> <body ng-app="myApp" ng-controller="myController"> <input ng-model="asd"> <button ng-click="bc()">add</button> <ul> <li ng-repeat="l in ullist track by $index">{{l}}</li> </ul> </body> </html>
angularJS输入内容渲染添加
最新推荐文章于 2021-02-15 13:29:09 发布