Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): add global lib docs #1747

Merged
merged 2 commits into from
Aug 22, 2016

Conversation

filipesilva
Copy link
Contributor

@filipesilva filipesilva commented Aug 19, 2016

This PR adds the global scripts functionality. It will allow users to designate javascript files to be loaded as if they were in a scripts tag in index.html. Global styles will be bundled in styles.bundle.js and global scripts will be in scripts.bundle.js, both loaded before main.bundle.js.

It also changes apps[0].styles to be an array in order to match the new apps[0].scripts and better allow loading scripts and styles together.

angular-cli.json :

{
  // ...
  "apps": [
    {
      // ...
      "styles": [
        "styles.css"
      ],
      "scripts": [ ],
      // ...
    }
  ],
  // ...
}

Closes #1717

Functionality description in README:

Global Library Installation

Some javascript libraries need to be added to the global scope, and loaded as if
they were in a script tag. We can do this using the apps[0].scripts and
apps[0].styles properties of angular-cli.json.

As an example, to use Boostrap 4 this is
what you need to do:

First install Bootstrap from npm:

npm install bootstrap@next

Then add the needed script files to to apps[0].scripts.

"scripts": [
  "../node_modules/jquery/dist/jquery.js",
  "../node_modules/tether/dist/js/tether.js",
  "../node_modules/bootstrap/dist/js/bootstrap.js"
],

Finally add the Bootstrap CSS to the apps[0].styles array:

"styles": [
  "styles.css",
  "../node_modules/bootstrap/dist/css/bootstrap.css"
],

Restart ng serve if you're running it, and Bootstrap 4 should be working on
your app.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow globally loaded javascript libs
3 participants