- Tên Ebook: AngularJS - Chapter 00 - Overview
- Loại file: PDF
- Dung lượng: 1 MB
- Số trang:
LINH TẢI:
TRÍCH DẪN:
AngularJS by Examples Chapter 00 Reviews Javascript Introduction to JavaScript ❖ JavaScript is the programming language of HTML and the Web. ❖ Programming makes computers do what you want them to do. ❖ JavaScript is easy to learn. ❖ Example at javascript - Example 01 Advantages of JavaScript ❖ Less server interaction − You can validate user input before sending the page off to the server. This saves server traffic, which means less load on your server. ❖ Immediate feedback to the visitors − They don't have to wait for a page reload to see if they have forgotten to enter something. ❖ Increased interactivity − You can create interfaces that react when the user hovers over them with a mouse or activates them via the keyboard. ❖ Richer interfaces − You can use JavaScript to include such items as drag-and- drop components and sliders to give a Rich Interface to your site visitors. Limitations of JavaScript ❖ Client-side JavaScript does not allow the reading or writing of files. This has been kept for security reason. ❖ JavaScript cannot be used for networking applications because there is no such support available. ❖ JavaScript doesn't have any multithreading or multiprocessor capabilities. JavaScript - Syntax ❖ JavaScript can be implemented using JavaScript statements that are placed within the HTML tags in a web page. ❖ You can place the AngularJS Extends HTML ❖ AngularJS extends HTML with ng-directives. ❖ The ng-app directive defines an AngularJS application. ❖ The ng-model directive binds the value of HTML controls (input, select, textarea) to application data. ❖ The ng-bind directive binds application data to the HTML view. ❖ Example at Chapter 01 - Example 01 Example explained ❖ AngularJS starts automatically when the web page has loaded. ❖ The ng-app directive tells AngularJS that theelement is the "owner" of an AngularJS application. ❖ The ng-model directive binds the value of the input field to the application variable name. ❖ The ng-bind directive binds the innerHTML of theelement to the application variable name. AngularJS Directives ❖ As you have already seen, AngularJS directives are HTML attributes with an ng prefix. ❖ The ng-init directive initializes AngularJS application variables. ❖ Example at Chapter 01 - Example 02 AngularJS Expressions ❖ AngularJS expressions are written inside double braces: {{ expression }}. ❖ AngularJS will "output" data exactly where the expression is written. ❖ Example at Chapter 01 - Example 03 AngularJS Applications ❖ AngularJS modules define AngularJS applications. ❖ AngularJS controllers control AngularJS applications. ❖ The ng-app directive defines the application, the ng-controller directive defines the controller. ❖ Example at Chapter 01 - Example 04 Example explained ❖ AngularJS modules define applications ❖ AngularJS controllers control applications