简体   繁体   English

如何设置开发环境,例如egghead.io视频

[英]How to setup dev environment like egghead.io videos

I want to setup a environment on my machine to learn AngularJS. 我想在机器上设置一个环境来学习AngularJS。 I saw in the videos of egghead.io where he keeps typing AngularJS code and when it refreshes through a server and displays the changes in realtime in the browser. 我在egghead.io的视频中看到他不断输入AngularJS代码,以及当它通过服务器刷新并在浏览器中实时显示更改时的情况。 How to do that? 怎么做? I see WebStrom logo in the videos but that's it. 我在视频中看到了WebStrom徽标,仅此而已。

You will need a server to setup your files. 您将需要服务器来设置文件。 The videos you saw might have used browser-reload plugin which watches the files for changes and refreshes the page as soon as there's a change in any of the files. 您看到的视频可能使用了浏览器重新加载插件,该插件可以监视文件中的更改并在任何文件中有更改时刷新页面。 You can use yeoman (and one of the generators) for project setup (for scaffolding basically). 您可以使用yeoman (和其中一种生成器)进行项目设置(基本上用于脚手架)。 You will need to install NodeJS first which will install NPM (node package manager) with it. 您将需要首先安装NodeJS ,它会同时安装NPM(节点程序包管理器)。 Then you can install YEOMAN and use the generator respectively. 然后,您可以安装YEOMAN并分别使用生成器。 My recommendation would be generator-gulp-angular . 我的建议是generator-gulp-angular See the readme for the instructions, but basically you'll have to run these commands in command prompt after you've installed NodeJS properly. 有关说明,请参见自述文件,但基本上,正确安装NodeJS后,您必须在命令提示符下运行这些命令。

npm install -g yo gulp bower

the above command installs yeoman,gulp and bower respectively 上面的命令分别安装yeoman,gulp和bower

npm install -g generator-gulp-angular

the above command installs the gulp-angular yeoman generator 上面的命令安装了gulp-angle yeoman生成器

Then you can create a directory, say 'testDir' and navigate into it. 然后,您可以创建一个目录,说“ testDir”并导航到该目录。 Ie

cd testDir

Then run 然后跑

yo gulp-angular

You'll be asked to select desired technologies. 系统会要求您选择所需的技术。 Once you're done, you can run the following command to see it working (with live reload) 完成后,您可以运行以下命令以查看其工作情况(实时重新加载)

gulp serve

not sure what video you're talking about but it sounds like he/she has a gulp or grunt task that is watching for changes and then livereloading your browser. 不确定您在说什么视频,但听起来他/她的任务很艰巨,正在监视更改,然后实时重新加载浏览器。 It could be either 可能是

or 要么

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM