The first learning application example of angularjs Chinese community

Time:2021-3-6

preface

As we all know, angularjs has become a hot front-end framework. Angularjs has become the most popular open source JavaScript framework in the world of web application development. But although angularjs 2 has been released for a long time, the relevant learning documents and materials are not perfect. Following the introductory course of angularjs Chinese community, I found some mistakes at the beginning of my study… So I wrote this article…

Download phonecat source code

Use git to download the source code for learninggit clone git://github.com/angular/angular-phonecat.git

Start the service

1. Enter the downloaded source code angular phonecat Directory: run the following command:git checkout -f step-0

This command will reset the working directory of the phonecat project. It is recommended to run this command at each learning step to change the number in the command to the number corresponding to your learning step. This command will clear any changes you have made in the working directory.

2. Start the service and run the command:npm start, the process takes a few minutes.

The first learning application example of angularjs Chinese community

The following figure shows that starting up HTTP server, serving. / app is successful.

The first learning application example of angularjs Chinese community

Open browser input localhost:8000 You can see “nothing here yet!” on the page

The first learning application example of angularjs Chinese community

Indicates that the environment is configured successfully.

Angularjs Chinese community use the command here:node scripts/web-server.js, will report an error,

Error prompt: module.js:442

throw err;
^

Error: Cannot find module ‘G:fontEndstudyNodeAngularJSangular-phonecatscrip
tsweb-server.js’

The first learning application example of angularjs Chinese community

Look at the path, there is no web- server.js Documents. So we’ll use the command insteadnpm startThe error can be resolved and the service can be started successfully.