This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OPTION B: "Angular way" => Class | |
// In Angular example, use this snippet inside AfterViewInit lifecycle hook: | |
class MyAngularComponent implements AfterViewInit { | |
// Through @ViewChild decorator, Angular will get the first element matches selector in the DOM | |
@ViewChild('counter', { static: false }) counter; | |
ngAfterViewInit() { | |
// Angular-way | |
this.counter.nativeElement |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OPTION A: "standard way" => Class | |
// In Angular example, use this snippet inside AfterViewInit lifecycle hook: | |
class MyAngularComponent implements AfterViewInit { | |
ngAfterViewInit() { | |
// Standard-way | |
document.querySelector('#clickCounter') | |
.addEventListener('counter-clicked', this.myCallbackFunction); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Template: web component inside an Angular component --> | |
<div> | |
<h1>I'm an Angular component</h1> | |
<click-counter id='clickCounter'></click-counter> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Template: Angular component containing web component --> | |
<div> | |
<h1>I'm an Angular component</h1> | |
<print-full-name | |
name="{{ user.name }}" | |
surname="{{ user.surname }}"> | |
</print-full-name> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML file --> | |
<my-web-component></my-web-component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML file --> | |
<template id="myTpl"> | |
<h1>Hi, I am a WebComponent!</h1> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// JavaScript code for creating "my-web-component" custom element | |
// using HTMLElement as base class from which to extend | |
customElements.define('my-web-component', class extends HTMLElement { | |
constructor() { | |
super(); | |
// Find an HTML snippet (template used by WebComponent) | |
const template = document.querySelector('#myTpl'); | |
const templateContent = template.content; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://docs.google.com/presentation/d/1YWe46QRe5SHJzU_BP66AMWg3pHp-YC0VT_us11xOYbA/edit#slide=id.g62e0a832ab_2_110 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Clone your fork: | |
git clone <your-forked-repo>.git | |
# 2. Add remote from original repository in your forked repository: | |
cd forked-repo | |
git remote add upstream <your-forked-repo>.git | |
git fetch upstream | |
# 3. Updating your forked repo from original one to keep up with their changes: | |
git pull upstream master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes |
NewerOlder