Add ability to import, install & setup an external library into your project
See original GitHub issueBackground
Adding support for an external library (i.e. @angular/material
) into your project can be a difficult task for a few reasons, most notably is the multiple steps to get things configured and setup properly. This could require going back and forth between documentation, blog posts and/or video tutorials.
Desired behavior
Add a command to the Angular CLI which would allow users to add functionality of a library to their project.
ng add [name of library]
An example would be to add support for @angular/material
which could handle the following steps automatically:
- add dependencies (
@angular/material
,@angular/cdk
,@angular/animations
) - import the necessary and/or most common modules to the root NgModule
BrowserAnimationsModule
MatButtonModule
- add a theme
- add gesture support
- add material icons
Implementation Considerations
Determination of the library to be added: possibilities considered thus far:
- a pre-determined name which can resolve to a library/schematic (i.e.
material
->@angular/material
)- pros: simpler cognitive load on users
- cons: maintaining a list of libraries is not practical
- a schematic path (i.e. `@angular/material:add)
- pros: very explicit about what will be run
- cons: could cause confusion and allow running of any schematic
- the package name (i.e.
@angular/material
) map to the schematic could live in the package’spackage.json
file- pros: clearly conveys what logic will be added, gives control/responsibility to the library owner
- cons: no clear cons at this time
Additional/Future Features
Add an option to ng new
to allow adding library support upon project creation
ng new foo --add=[name of library]
Issue Analytics
- State:
- Created 6 years ago
- Reactions:11
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Installing an external library that is required by a contributed ...
Install the external library ... First you need to check if there is a libraries directory in one of three suitable spots. These...
Read more >Working with External Libraries in Python - Datagy
We can use the pip tool to install external libraries; When using external libraries, we can import the entire library or only some...
Read more >how to install libraries from zip in Platform IO - YouTube
It's time to move forward and import the external libraries we want ... Method 2:Platform IO Project Configuration File 00:03:48 Method...
Read more >Adding External Library in Android Studio - YouTube
Explained three ways to add any kind of external library to the Android Studio project.1. Adding Gradle dependency.2. Adding .jar or .aar ...
Read more >Using external libraries - Creative Coding - Allison Parrish
Locate the correct Javascript download of the library you want to install. · Download the library and make a copy in your sketch...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It would be great to be able to add libraries interactively. For example, if we ran
ng add @angular/material
a console start to asking us what we want to include, change, where we should place modifications, etc. It may store answers in variables that is passed then to schematics of a library (material in this case). So, in that way we need tools to make possible easily write own library with set of questions, variables and rules to apply changes that are needed to user.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.