Skip to content

Instantly share code, notes, and snippets.

View picheli20's full-sized avatar
🐟
Deep diving into open source code

Fabio Picheli picheli20

🐟
Deep diving into open source code
View GitHub Profile
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CounterComponent } from './counter.component';
describe('CounterComponent', () => {
let component: CounterComponent;
let fixture: ComponentFixture<CounterComponent>;
beforeEach(async(() => {
/**
{
...
"scripts": {
...
"serve": "concurrently \"npm run ui-jar\" \"ng serve\"",
"ui-jar": "node node_modules/ui-jar/dist/bin/cli.js --directory ./projects/ --includes \\.ts$",
"docs:watch": "npm run ui-jar -- --watch"
},
...
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>UiJar</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
@import '../node_modules/foo/bar/src/main.scss';
@include init($color-pallete);
@import './lib/counter/counter.mixing.scss';
@mixin init($color-pallete) {
// List of all mixing that you need for this library
@include counter($color-pallete);
}
@picheli20
picheli20 / counter.mixing.scss
Created October 31, 2018 15:44
Library with Angular 6+: The ultimate guide - mixing
/**
$color-pallete: (
500: #fff,
contrast: (
500: #000,
),
);
*/
@mixin counter($color-pallete) {
@picheli20
picheli20 / counter.component.html
Created October 31, 2018 15:34
Library with Angular 6+: The ultimate guide - Counter component
<button (click)="increase()" class="counter-button"> {{ text }} {{ counter }} </button>