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
@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>
@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) {
@import './lib/counter/counter.mixing.scss';
@mixin init($color-pallete) {
// List of all mixing that you need for this library
@include counter($color-pallete);
}
@import '../node_modules/foo/bar/src/main.scss';
@include init($color-pallete);
<!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>
{
...
"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"
},
...
}
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CounterComponent } from './counter.component';
describe('CounterComponent', () => {
let component: CounterComponent;
let fixture: ComponentFixture<CounterComponent>;
beforeEach(async(() => {
/**
@picheli20
picheli20 / script.js
Last active September 12, 2024 09:01
Create automatically tags
(async () => {
const text = `
a 1
b 2
c 3
d 4
`;
const addRowClass = `wd-vt-simple-table-add-row`;
// const removeRowClass = `wd-vt-st-remove-row-button`;