CombineLatest vs WithLatestFrom

For me working with Angular was the only reason I got familiar with RxJs. Had to even at that time I wished they’d stick with promises! With that as you can imagine I did the minimally needed read on…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to use web components in Angular 6

Web component have been in discussion for a while and with the webcomponentsjs polyfil from the polymer project, developers can finally take advantage of this powerful tool. Since the standard is independent of the frameworks, the components can be used in any architecture and offer simple option of integrating the components in your project. But how is it possible to use web components in an Angular 6 project?

Before we can start we need to create a new angular project using the Angular CLI.

Bower saves the dependencies of a project in a file called bower.json. To generate such a file use the init command of bower and follow the prompted instructions.

Since Angular uses npm to manage its dependencies, the setup for developers usually is limited to a simple npm install, which triggers npm to install all dependencies. To keep this functionality with bower we need to add a postinstall script in the package.json. The postinstall script is called by npm after the install command has finished. We will use this script in order to trigger bower to install the dependencies listed in the bower.json file.

This will affect all file paths of the app. Therefore all paths need to be updated.

Now that everything is set up, we can use the google-map component in our project. Just add the tag in your app.component.html and add a style to give it a size (otherwise it may not show).

Thank you for reading my article. I hope you found this tutorial helpful. This is my first post here on medium and I’d be happy for feedback. Or if you know a more elegant solution on integrating web components feel free to share.

Add a comment

Related posts:

I met Someone who I want to date...

I met Someone. Someone that I yearn to date. Someone that makes my heart skip a beat. Someone who gets me speechless. Yet, I’m unable to date Someone. So many people distracting me. I don’t even know…

Leas

Her mother died when she was young, and her father lost his leg to a land mine during the Cambodian Civil War in the early 90s. Leas, 20, is the oldest child in her family and is also the sole…

What is ZetaChain?

ZetaChain is a basic public blockchain that supports the omnichain, general smart contracts and message passing between any blockchains. It solves the problems of “cross-chain” and “multi-chain”, and…