Foreword
## Front-end
AngularJS is designed to overcome the shortcomings of HTML in building applications. (Quote from Baidu Encyclopedia)
AngularJS uses a different approach. It tries to make up for the shortcomings of HTML itself in building applications. AngularJS enables browsers to recognize the new syntax by using structures we calldirectives. (Quote from Baidu Encyclopedia)For example:Use double curly brackets {{}} syntax for data binding ;
Use DOM control structures to iterate or hide DOM fragments;
Support forms and form validation;
wanted should be associated:
This study mainly has two parts: ①【AngularJS common instructions】②【AngularJS’s mvc】
【Common commands】 1.na-app: Declare the area governed by angularjs, usually written in the body or HTML. In principle, only write one on each side. #& Lt; body ng-apg = "" & gt; & lt;/body & gt; 2.ng-Model instructions bind the elemental value (such as the value of the input domain) to the application. not not have been more relevant? Since The ng-init directive initializes AngularJS application variables. Numbers, operators and variables. But the expression will see {{}} when the web page is loaded, so you can use ng-bind=" instead {{5+""+5+',Angular'}} [Basic Thoughts] Instructions: In AngularJS, functions are provided by extending the attributes of HTML ↓↓↓↓ (original words in the novice tutorial) AngularJS instructions are extended HTML Attributes with prefix NG-. The element value (such as the value of the input field) is bound to the application. mvc for AngularJS [mvc three-tier framework] 1. Model: the part of the application that handles attributes. (Save or modify data to database, variables, etc.). The characteristics of the Model in AugularJS are: data . Responsible for reading data from views, controlling user input, and sending data project-wide. 2. Working principle: The user sends a request from the view layer. After receiving the request, the controller forwards it to the corresponding model for processing. After the medle processing is completed, the result is returned to the controller and fed back to the user in the view. Create an Angular module, that is, parts bound by NG-APP, you need to pass two parameters:
① the module name, that is, the name that Ng-APP needs to be bound to . ng-app="myApp"; ② Array: The name of the module that needs to be injected. It can be empty if not required. var app = Angular.module ("MyApp", []); On the Angular module, creating a controller Controller needs to pass two parameters. ① ng-controller="myCtrl" ② Controller's constructor: The constructor can pass in multiple parameters, including $scope/$roatScope and various system built-in objects Scope】 ①$scope: local scope, properties and methods declared on $scope can only be used in the current Controller; ②$rootScope: root scope, declared on $rootscope Familiarity and methods can be used in any area contained by ng-app (whether or not it agrees with the controller, or is in the controller's containing scope). # , then this variable will be bound to the $scope of the current Controller by default 2. If ng-model is not in any ng-controller, this variable will be bound to $rootScope. The rendering is as follows: ![]()
##The code is as follows: There may be some mistakes in the notes taken while studying. Your criticism and advice are welcome. Reflect, review, and gain something every day------------------------looking forward to a better self
1 nbsp;html> 2 3 4 <meta> 5 <title></title> 6 <style> 7 .div1{ 8 width: 300px; 9 height: 100px;10 background-color: #00BFFF;11 }12 </style>13 14 15 <div>16 <input>17 <div></div>18 <div></div>19 <div></div>20 <div></div>21 <div></div>22 <div></div>23 24 </div>25 <div>26 <input>27 <div></div>28 <div></div>29 30 </div>31 32 33 <script></script>34 <script>35 var app = angular.module("myApp",[]); 36 app.controller("myCtrl",function($scope){37 $scope.name = "帅哥" ;38 $scope.age = "18岁";39 $scope.classes = {40 name:"张三",41 age:"16岁",42 sex:"男"43 44 };45 46 });47 48 app.controller("myCtrl1",function($rootScope){49 $rootScope.name = "hahaha" ;50 });51 52 </script>53 |
The above is the detailed content of Basic introduction and practice of AugularJS. For more information, please follow other related articles on the PHP Chinese website!

HTML5isamajorrevisionoftheHTMLstandardthatrevolutionizeswebdevelopmentbyintroducingnewsemanticelementsandcapabilities.1)ItenhancescodereadabilityandSEOwithelementslike,,,and.2)HTML5enablesricher,interactiveexperienceswithoutplugins,allowingdirectembe

Advanced tips for H5 include: 1. Use complex graphics to draw, 2. Use WebWorkers to improve performance, 3. Enhance user experience through WebStorage, 4. Implement responsive design, 5. Use WebRTC to achieve real-time communication, 6. Perform performance optimization and best practices. These tips help developers build more dynamic, interactive and efficient web applications.

H5 (HTML5) will improve web content and design through new elements and APIs. 1) H5 enhances semantic tagging and multimedia support. 2) It introduces Canvas and SVG, enriching web design. 3) H5 works by extending HTML functionality through new tags and APIs. 4) Basic usage includes creating graphics using it, and advanced usage involves WebStorageAPI. 5) Developers need to pay attention to browser compatibility and performance optimization.

H5 brings a number of new functions and capabilities, greatly improving the interactivity and development efficiency of web pages. 1. Semantic tags such as enhance SEO. 2. Multimedia support simplifies audio and video playback through and tags. 3. Canvas drawing provides dynamic graphics drawing tools. 4. Local storage simplifies data storage through localStorage and sessionStorage. 5. The geolocation API facilitates the development of location-based services.

HTML5 brings five key improvements: 1. Semantic tags improve code clarity and SEO effects; 2. Multimedia support simplifies video and audio embedding; 3. Form enhancement simplifies verification; 4. Offline and local storage improves user experience; 5. Canvas and graphics functions enhance the visualization of web pages.

The core features of HTML5 include semantic tags, multimedia support, offline storage and local storage, and form enhancement. 1. Semantic tags such as, etc. to improve code readability and SEO effect. 2. Simplify multimedia embedding with labels. 3. Offline storage and local storage such as ApplicationCache and LocalStorage support network-free operation and data storage. 4. Form enhancement introduces new input types and verification properties to simplify processing and verification.

H5 provides a variety of new features and functions, greatly enhancing the capabilities of front-end development. 1. Multimedia support: embed media through and elements, no plug-ins are required. 2. Canvas: Use elements to dynamically render 2D graphics and animations. 3. Local storage: implement persistent data storage through localStorage and sessionStorage to improve user experience.

H5 and HTML5 are different concepts: HTML5 is a version of HTML, containing new elements and APIs; H5 is a mobile application development framework based on HTML5. HTML5 parses and renders code through the browser, while H5 applications need to run containers and interact with native code through JavaScript.


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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

Atom editor mac version download
The most popular open source editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Linux new version
SublimeText3 Linux latest version

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
