Giter Site home page Giter Site logo

angularclass / angular-bootloader Goto Github PK

View Code? Open in Web Editor NEW
31.0 7.0 4.0 11 KB

:fast_forward: Angular 2 (and Angular 4) Bootloader for async script tag and hmr support via @AngularClass

Home Page: https:angularclass.com

License: Apache License 2.0

TypeScript 100.00%
angularclass hmr-support async-tag angular2 angular angular4

angular-bootloader's People

Contributors

patrickjs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-bootloader's Issues

Question: Vendor file

If I'm splitting my js files into 2 groups - one is the vendor file and the other is the app bundle - can I still use this repo?
Is possible to add async tag to both script tags? If yes, how the browser will choose which one to load first?

Thanks!

Question: How to even use this?

I found this library while searching how to load my angular bundles with defer attribute. Even async is fine for me.

After spending 2+ hours on this library, I have an absolute zero idea how to make it work. I tried it in fresh project but no success.

Repo: https://github.com/goodmite/bootloader-not-working

I Created a fresh project and in main.ts did this. It did not work.

// platformBrowserDynamic().bootstrapModule(AppModule).catch(err => console.error(err))

  export function main() {
    return platformBrowserDynamic().bootstrapModule(AppModule);
  }
  bootloader(main); // this will bootstrap your app via main function

Result: No async scripts in index.html


 <!doctype html>

   <html lang="en">
   <head>
   <meta charset="utf-8">
   <title>AngularTest</title>
   <base href="/">
    
   <meta name="viewport" content="width=device-width, initial-scale=1">
   <link rel="icon" type="image/x-icon" href="favicon.ico">
   <link rel="stylesheet" href="styles.3ff695c00d717f2d2a11.css"></head>
   <body>
   <app-root></app-root>
   <script type="text/javascript" src="runtime.3ad3e88387299ab1fa63.js"></script><script type="text/javascript" src="polyfills.e254f6b9bf511460eb6d.js"></script><script type="text/javascript" src="main.f6e46af22b8eab9da529.js"></script></body>
   </html>

I have a few questions. All of these would be automatically answered if you could provide one basic repo which uses this library.

  1. How to use this? What is the MainModule in the ReadMe? Is it the root module or the feature module? I tried loading both with bootloader. No success.
  2. Does this work in angular cli projects?
  3. Does this work in projects which don't implement angular universal. I ask this because all of the tutorials for this library are in the context of angular universal.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.