Skip to content

Instantly share code, notes, and snippets.

View t-palmer's full-sized avatar

Todd Palmer t-palmer

  • Fujitsu
View GitHub Profile
import { NgModule } from '@angular/core';
import { ExampleNg6LibComponent } from './example-ng6-lib.component';
import { FooComponent } from './foo/foo.component';
@NgModule({
imports: [
],
declarations: [
ExampleNg6LibComponent,
FooComponent
<div style="text-align:center">
<h1>
Welcome to {{ title }}!
</h1>
<img width="300" alt="Angular Logo" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNTAgMjUwIj4KICAgIDxwYXRoIGZpbGw9IiNERDAwMzEiIGQ9Ik0xMjUgMzBMMzEuOSA2My4ybDE0LjIgMTIzLjFMMTI1IDIzMGw3OC45LTQzLjcgMTQuMi0xMjMuMXoiIC8+CiAgICA8cGF0aCBmaWxsPSIjQzMwMDJGIiBkPSJNMTI1IDMwdjIyLjItLjFWMjMwbDc4LjktNDMuNyAxNC4yLTEyMy4xTDEyNSAzMHoiIC8+CiAgICA8cGF0aCAgZmlsbD0iI0ZGRkZGRiIgZD0iTTEyNSA1Mi4xTDY2LjggMTgyLjZoMjEuN2wxMS43LTI5LjJoNDkuNGwxMS43IDI5LjJIMTgzTDEyNSA1Mi4xem0xNyA4My4zaC0zNGwxNy00MC45IDE3IDQwLjl6IiAvPgogIDwvc3ZnPg==">
</div>
<h2>Example</h2>
<enl-example-ng6-lib></enl-example-ng6-lib>
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { ExampleNg6LibModule } from 'example-ng6-lib';
@NgModule({
declarations: [
AppComponent
],
"projects": {
"example-ng6-lib-app": {
},
"example-ng6-lib-app-e2e": {
},
"example-ng6-lib": {
"root": "projects/example-ng6-lib",
"sourceRoot": "projects/example-ng6-lib/src",
@t-palmer
t-palmer / lite-bs-config.json
Last active April 19, 2018 00:32
Sample lite-server config file
{
"port": 3000,
"server": {
"baseDir": "."
},
"browser": ["chrome"]
}
@t-palmer
t-palmer / lite-package.json
Last active April 14, 2018 13:45
Example package.json file for lite-server
{
"name": "lite",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "lite-server"
},
"keywords": [],
"author": "",
@t-palmer
t-palmer / lite-index.html
Created April 14, 2018 00:09
Simple index.html example for lite-server article
<!DOCTYPE html>
<html>
<head>
<title>lite-server</title>
</head>
<body>
<a href="https://github.com/johnpapa/lite-server">lite-server</a> is awesome!
</body>
</html>
@t-palmer
t-palmer / polyfills.ts
Last active August 26, 2019 18:43
polyfills file for so Angular can support Internet Explorer
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
@t-palmer
t-palmer / this-tester.js
Last active March 29, 2018 12:33
An example of lexical this in arrow functions.
class ThisTester {
constructor () {
this.testValue = 'ThisTester Class';
}
// in arrow functions we can freely use "this".
thisArrowTest() {
// define a local function like we might use in a promise or callback
let myFunction = (x) => console.log('arrow "this" works:', this.testValue)
@t-palmer
t-palmer / toh-index.html
Last active March 28, 2018 14:29
Tour of Heroes index.html updated to support deployment anywhere.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Tour of Heroes</title>
<base href="/" id="baseHref">
<script>
(function() {
var mypath = window.location.pathname;