Angular addition, deletion, modification, checking and verification
This article mainly introduces the addition, deletion, modification, checking and verification of angular. Interested friends can refer to it.
The code is as follows:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>增删改查</title> <script src="js/angular.min.js"></script> <script> var app = angular.module("anan", []); app.controller("enen", function($scope) { $scope.user = [{ ck:false, id: 1, name: '李1', pwd: 123456, level: 3 }, { ck:false, id: 2, name: '李2', pwd: 123456, level: 1 }, { ck:false, id: 3, name: '李3', pwd: 123456, level: 3 }, { ck:false, id: 4, name: '李4', pwd: 123456, level: 1 }, { ck:false, id: 5, name: '李5', pwd: 123456, level: 2 }, {ck:false, id: 6, name: '李6', pwd: 123456, level: 3 }, { ck:false, id: 7, name: '李7', pwd: 123456, level: 2 }, { ck:false, id: 8, name: '李8', pwd: 123456, level: 1 }, { ck:false, id: 9, name: '李9', pwd: 123456, level: 2 }, { ck:false, id: 10, name: '李10', pwd: 123456, level: 1 }]; $scope.ckAll=function(){ for(var i=0;i<$scope.user.length;i++){ $scope.user[i].ck=$scope.flag; } } $scope.delso=function(){ var shu=0; for(var i=0;i<$scope.user.length;i++){ if($scope.user[i].ck){ $scope.user.splice(i,1); shu++; i--; } } } $scope.insert=function(m){ var good={ck:false,id:$scope.tid,name:$scope.tname,pwd:$scope.tpwd,level:$scope.tlevel}; $scope.user.push(good); } }) </script> <style type="text/css"> #cll:nth-child(even){ background-color: lightseagreen; } #cll:nth-child(odd){ background-color:#C9C994; } </style> </head> <body ng-app="anan" ng-controller="enen"> <div style="margin: 0 auto; height:800px; width: 1000px; border: 1px solid greenyellow; "> <input placeholder="用户名搜索" ng-model="souname"/> <select ng-model="jb"><option value="">选择级别</option ><option value="1">1</option><option value="2">2</option><option value="3">3</option></select> 排序<select ng-model="px"><option>排序</option> <option value="id">id</option><option value="level">级别</option></select><br/> <button style=" background-color: #008000; margin: 6px; color: #FFFFFF;" ng-click="m=true">新增用户</button><button style="color: #FFFFFF; background-color: crimson;margin: 6px;" ng-click="delso()">批量删除</button> <div style="width: 1000px;border: 1px solid greenyellow;" ng-show="m"> id:<input type="number" ng-model="tid"/> 用户名:<input ng-model="tname"/> 密码:<input ng-model="tpwd"/> 级别:<input type="number" ng-model="tlevel"/> <button ng-click="insert(m=false)">添加</button> </div> <table style="width: 1000px;" border="1px"> <tr style="background-color: cadetblue;"> <td><input type="checkbox" ng-click="ckAll()" ng-model="flag"/></td> <td>id</td> <td>用户名</td> <td>密码</td> <td>级别</td> <td>操作</td> </tr> <tr id="cll" ng-repeat="e in user|orderBy:px:false|filter:{name:souname}|filter:{level:jb}"> <td><input type="checkbox" ng-model="e.ck"/></td> <td>{{e.id}}</td> <td>{{e.name}}</td> <td><span> {{e.pwd}}</span> <span ng-show="f"> <input ng-model="e.pwd" /> <button ng-click="f=false">保存</button> </span></td> <td>{{e.level}}</td> <td><button ng-click="f=true">修改密码</button></td> </tr> </table> </div> </body> </html>
Related recommendations:
How Angular performs services Side rendering development
Tips on using router in Angular4
Detailed explanation of multiple component data communication cases shared by angular4
The above is the detailed content of Angular addition, deletion, modification, checking and verification. For more information, please follow other related articles on the PHP Chinese website!

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

HTML is the cornerstone of building web page structure. 1. HTML defines the content structure and semantics, and uses, etc. tags. 2. Provide semantic markers, such as, etc., to improve SEO effect. 3. To realize user interaction through tags, pay attention to form verification. 4. Use advanced elements such as, combined with JavaScript to achieve dynamic effects. 5. Common errors include unclosed labels and unquoted attribute values, and verification tools are required. 6. Optimization strategies include reducing HTTP requests, compressing HTML, using semantic tags, etc.

HTML is a language used to build web pages, defining web page structure and content through tags and attributes. 1) HTML organizes document structure through tags, such as,. 2) The browser parses HTML to build the DOM and renders the web page. 3) New features of HTML5, such as, enhance multimedia functions. 4) Common errors include unclosed labels and unquoted attribute values. 5) Optimization suggestions include using semantic tags and reducing file size.

WebdevelopmentreliesonHTML,CSS,andJavaScript:1)HTMLstructurescontent,2)CSSstylesit,and3)JavaScriptaddsinteractivity,formingthebasisofmodernwebexperiences.

The role of HTML is to define the structure and content of a web page through tags and attributes. 1. HTML organizes content through tags such as , making it easy to read and understand. 2. Use semantic tags such as, etc. to enhance accessibility and SEO. 3. Optimizing HTML code can improve web page loading speed and user experience.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor