简体   繁体   中英

Integrate a whole Yeoman, AngularJS project using one single file

I am currently creating a form, using Yeoman and AngularJS (1.2.27).

This form aims to be integrated in any of my clients web pages. So I can generate a dist folder with grunt, that contains a lot of files, such as JS files, CSS files, Images, Fonts, Components etc.

But what I would like, is to be able to give a single Javascript file that anyone can include to his website, and maybe a tag or something integrated by the client to his website as well. Then, this file will build the entire Angular application (which will be stored on my server) inside that tag.

Do you have any idea if such thing is possible, and if yes do you have some hints to give me?

Thanks guys

Do this:

  1. List down all your framework related files.
  2. List down all your JS files. This includes your routers, controllers, services, etc.

You can combine and minify the above files to generate 1 single JS file, something like 'application.js'. This file will take care of your entire app.

Now, since your index.html file is already there, include this 'application.js' file in your index file.

Comment if this is what you want to do.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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