Prepare angular 2 environment
Ng-bootstrap is based on angular 2, so it is necessary to prepare the angular 2 environment first.
Using Ng-bootstrap
Download Ng-bootstrap
Ng-bootstrap uses bootstrap 4.0 ALPHA2, so you need to download the
A. Create a project process:1.use Angular CLI to create a Angular Project "demo":Need the commmand of "Ng new Demo" to produce demo project.2.load the project to VscodeClick the File,select "Open Folder"Select Import Project "Demo"3.Configuration and install plugins in "Demo" ProjectUse "NPM install [e-mail protected]" command to produce [email protected] (node_modules)Use ' npm install jquery ' command to produce jquery (node_modules)Use the "npm install ANGULAR-IN-MEMORY-WEB-API" command to In
! // Projects.html [@ fadeIn] = "state" // error The provided animation trigger "c1 # fadeIn" has not been registered!
It seems that this method is not feasible. We should replace it with native CSS before we figure out the global reuse mechanism of angular2 animation.
Create an animation.css
. FadeIn {animation: fadeIn progress-in-out 1.5 s 1; // The parameters are as follows: animation name easing function animation time animation running times} @ k
Angular2 getting started, angular2 getting started
Recently, versions of angular2, 1, and 2 have changed significantly. The following summarizes some learning websites and installation steps.
Official Chinese website (required ):
Https://angular.cn
Lazy learning:
Http://www.imooc.com/learn/789
Support for bootstrap UI
Angular2 custom paging component, angular2 custom Paging
In the project, parameters sent from the frontend to the backend are as follows:
PageSize: number of entries per page
PageNo: Current page number
For example, if there are currently 1st pages and 20 records on each page, the background returns 20 records on 1st pages (SQL should use limit to retrieve paging data)
At the same time, the back-end interfa
"Preface"
This is also from the document written by Xiaofeng, I do end-to-end testing when the project is used. "Body"
Project Flow install webstorm-Continuous Integration Server
Download Address: http://www.jetbrains.com.cn/webstorm.html
New ANGULAR2 Project
Enter directly from the command prompt:
ng New Angular-cli-project
PS:ANGULAR2 basic files have been created, the next is to download the project depends on the Nodejs package, with Ng ne
Angular2 entry-Architecture Overview, angular2 Architecture OverviewToo many rows too many rowsIntroduction
In March 23, Angular4 was officially released (not 3 ). It seems that Angular2 is now learning again later-_-|. Angular2 has made great changes based on Angular1. I asked an
Implementation of Angular2 form custom validators, angular2 form
This article describes how to determine the result of the validators. Here, we will look at how to implement a custom validators.
Target
We need to implement a mobile phone number verification tool. The instance used is based on the instance in the previous article, that is, the form page of user information input. We add a cell phone number v
Example code of the angular2 series route transition animation and angular2 example code
Angular2's animation system gives you the ability to make a variety of animation effects, and strives to build an animation with the same performance as the native CSS animation.
Angular2 animation is mainly combined with @ Compone
{FormsModule} from '@ angular/forms'; // omit other @ NgModule ({imports: [BrowserModule, FormsModule], // omit other })
Initial form
Then, we start with a basic html form:
In the actual example, the bootstrap form style is used, and a set of input boxes should look like the following. However, in this article, to save the page display space, I omit the div, form-group, etc. We only need to care about how to use a template-driven form in
Angular2 entry-Data Binding and angular2 entry-level bindingToo many rows too many rowsIntroduction
In Angular2, the data binding method is one-way by default. The data binding method can be divided:
1. Property binding and interpolation expression component class-> Template
2. Event binding: Template-> component class
3. Bidirectional binding: Template
Zookeepe
here, Angular2 is packaged in production mode with Webpack2:Use rollup packaging or comparison pit, function and plug-in is not as webpack, the key does not support code separation, resulting in angular lazy loader will not be able to use. Specific steps:Angular=>aot=>webpack (Tree shaking Uglify)angular=>aot:First you need to rely on:"@angular/compiler" "@angular/compiler-cli" "@angular/platform-browser".NPM Install Them.Here is the directory structu
Angular2 countdown component usage details, angular2 Usage Details
The project encounters a countdown requirement. Considering that it will be used in other modules in the future, it encapsulates a component by itself. It is easy to reuse later.
The component requirements are as follows:-Receiving the delivery deadline of the parent component-Receive parent-level component delivery title
Component Effect
V
How to use pipeline Pipe of Angular2, and pipeline pipe of angular2
Pipeline Pipe can use data as input and convert and output data according to rules. There are many built-in Pipe in Angular2, such as DatePipe, UpperCasePipe, and currenpolicipe. Here we will mainly introduce how to customize Pipe.
1. MPS queue Definition
The following code defines Pipe:
import {
Detailed explanation of Http request principles and usage in angular2 and angular2
This document describes the principles and usage of Http requests in angular2. We will share this with you for your reference. The details are as follows:
Provide HTTP Services
HttpModule is not the core module of Angular. Angular is an optional method for Web access.@angular/http.
to be introduced into Angular2/core to be used.
Import {Component} from ' Angular2/core ';
In typescript, we add annotations to the class, and the annotations are simple, annotated with @ as a prefix.
@Component ({
selector: ' My-app ',
Template: '
@Component tell angular that this class is a component. There are two parameters, selector and template.
The selector parameter
Angular2 explains how to build an environment and how to develop it.
Angular-CLI
Speaking of cli, there is no stranger to everyone. Every framework has a corresponding cli, commonly known as scaffolding. Angular2 itself provides a starting project angular2-quickstart, I tried it, found that not very easy to use, most of the other extensions need to be installed o
The release of Angular2 has brought about a heated discussion. It was a long time ago in preparation. At that time, the official answer was to thoroughly overturn the rewriting. After the publication, everyone's call was that the learning cost was too high, although some concepts in 1.x are removed, typescript is added. Although it is not mandatory, I recommend you try it. After all, this version is a product of Google and Microsoft.If you want to
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.