简体   繁体   English

应该在客户端添加哪个angular2 js文件?

[英]which angular2 js file should be added in on the client side?

I am a semi noob in web development. 我是网络开发中的半菜鸟。

I just started playing around with angular2 today. 我今天才刚开始使用angular2。 And i ran into a problem.. 我遇到了一个问题。

If I were to install angular2 with npm to my local computer, which file is the js file that should be linked to the html page that show up on the client? 如果我要在本地计算机上将带有npm的angular2安装到本地计算机上,应该链接到客户端上显示的html页面的js文件是哪个文件?

In their guide, i see a file called /node_modules/angular2/bundles/angular2.sfx.dev.js. 在他们的指南中,我看到了一个名为/node_modules/angular2/bundles/angular2.sfx.dev.js的文件。 But i don't even see this file at all. 但是我什至都看不到这个文件。

Is there some script that i should run to build that file? 我应该运行一些脚本来构建该文件吗? Or is the file renamed? 还是文件被重命名? I am really confused. 我真的很困惑。

I tried some file /angular2/bundles/angular2.js, but it doesn't even export ng variable to window! 我尝试了一些文件/angular2/bundles/angular2.js,但它甚至没有将ng变量导出到窗口!

I see that in https://code.angularjs.org/2.0.0-alpha.44/angular2.sfx.dev.js , eventually ng gets exported. 我在https://code.angularjs.org/2.0.0-alpha.44/angular2.sfx.dev.js中看到,最终ng被导出。 But what changed in alpha 53? 但是alpha 53发生了什么变化? (the version i get for doing npm install angular2) (我通过执行npm install angular2获得的版本)

In my projects, I a using 在我的项目中,

"node_modules/angular2/bundles/angular2.dev.js" “ node_modules / angular2 / bundles / angular2.dev.js”

You might additionally need to install/add systemjs, just in case you are using the systemjs library. 可能还需要安装/添加systemjs,以防万一您正在使用systemjs库。

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

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