This is the project code that is referenced in the video "The Experimental Release of Angular Elements" from the Nrwl Angular Enterprise Playbook course Angular v6: What is Coming and Updates Since v5.
Run npm i
or yarn
from within the directory.
Then run npm run build:elements
or yarn build:elements
to build the Angular Elements example.
After running that you can open the dist-elements/index.html
file in a browser to see the Angular Element in action.
If you make changes to your code, you will want to re-run the build:elements
script to build those changes.
- The
angular-elements-labs.tgz
is in here to be able to install@angular/elements
as a dependency and use the import path in the same way as expected when Angular version 6.0.0 is released. It is a copy of the code from thelabs/elements
branch of the Angular repo. The@angular/elements
scoped package is not published to npm so it can't be installed from there. Once that is available thistgz
file can be removed and the dependency in thepackage.json
can be set to the current version number instead of the local file. - While the
tgz
is used, you will need to build theelements
app using the--prod
flag that will build for AOT (thebuild:elements
npm script does this). This might not be an issue when the scoped package becomes available, but we'll see...