Skip to content

Instantly share code, notes, and snippets.

View alevshunov's full-sized avatar
🏹

Anton Levshunov alevshunov

🏹
  • ObjectStyle LLC
  • Minsk
View GitHub Profile
@alevshunov
alevshunov / webpack.config.js
Created October 2, 2019 14:27
Resolve modules which have been added using `npm link` or `yarn link`
const fs = require('fs')
const path = require('path')
// absolute paths to all symlinked modules inside `nodeModulesPath`
// adapted from https://github.com/webpack/webpack/issues/811#issuecomment-405199263
const findLinkedModules = (nodeModulesPath) => {
const modules = []
fs.readdirSync(nodeModulesPath).forEach(dirname => {
const modulePath = path.resolve(nodeModulesPath, dirname)
@alevshunov
alevshunov / 01.html
Last active October 27, 2016 12:55 — forked from jhades/01.html
Introduction to Angular 2 Forms - Template Driven, Model Driven Or In-Between
<section class="sample-app-content">
<h1>Template-driven Form Example:</h1>
<form #f="ngForm" (ngSubmit)="onSubmitTemplateBased()">
<p>
<label>First Name:</label>
<input type="text"
[(ngModel)]="user.firstName" required>
</p>
<p>
<label>Password:</label>