Skip to content

Instantly share code, notes, and snippets.

View Hotell's full-sized avatar
🎯
Focusing

Martin Hochel Hotell

🎯
Focusing
View GitHub Profile
@Hotell
Hotell / ng1mapToReactJs.md
Last active August 29, 2015 14:27
Mapping Angular 1 to ReactJS Api

Angular Component composition via ReactJS style API

This is my recomendation how to write angular components with leveraging react style component API naming.

And Remember, Respekt is everything! :)

Notes

  • ny - is not new york :D, it's our meetup group prefix ngParty, come to our meetup yo ngParty

@TODO

@Hotell
Hotell / defaults-overrides.md
Last active August 26, 2015 09:48 — forked from ericelliott/defaults-overrides.md
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {
// include material 2 into angular-cli-build.js
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'@angular2-material/**/*.js'
]
});
const materialPackages:string[] = [
'core',
'toolbar',
'icon',
'button',
'sidenav',
'list',
'card',
'input',
'radio',
@Hotell
Hotell / system-config.ts
Created May 21, 2016 13:25
barrels conifg for Angular CLi + system JS
/***********************************************************************************************
* Everything underneath this line is managed by the CLI.
**********************************************************************************************/
const barrels: string[] = [
// Angular specific barrels.
'@angular/core',
'@angular/common',
'@angular/compiler',
'@angular/http',
'@angular/router',
@Hotell
Hotell / install.md
Last active June 16, 2016 21:28
ng-metadata 2.0 nightly

Execute following commands:

git clone -b 2.0 https://github.com/ngParty/ng-metadata.git

cd <path-to-your-project>

npm i -S <path-to-cloned-ng-metadata-repo>
@Hotell
Hotell / app.component.ts
Last active July 27, 2017 04:07
@ngrx/store integration with ngMetadata/Angular 1
import { Store } from 'ngrx-one/store';
import { INCREMENT, DECREMENT, RESET } from './counter';
interface AppState {
counter: number;
}
@Component({
selector: 'my-app',
template: `
@Hotell
Hotell / app\app.component.ts
Created June 30, 2016 22:24
ngMetadata 2.x - quick start
import { Component } from 'ng-metadata/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 1 App <small>with ng-metadata!</small></h1>'
})
export class AppComponent { }
@Hotell
Hotell / app\app.component.ts
Last active June 26, 2018 12:35
ngMetadata 2.x - with @ngrx/store
import { Component } from 'ng-metadata/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 1 App <small>with ng-metadata!</small></h1>'
})
export class AppComponent { }
@Hotell
Hotell / setup-fork.sh
Last active April 1, 2017 20:36
Forking repo steps
#!/bin/bash
git clone <git.your-forks-url> && cd $_
# add remote to original project
git remote add upstream <git.forked-project-origin-url>
# fetch headers
git fetch upstream
# point master branch to original master so we can pull from original project and update our fork
git branch --set-upstream-to=upstream/master master