Skip to content

Instantly share code, notes, and snippets.

import { Input, Output, EventEmitter, ViewChild, ElementRef, Directive, Renderer } from ‘@angular/core’;
declare var jQuery: any;
@Directive({
selector: ‘[myDatepicker]’
})
export class DatePicker {
@Input() value = ‘’;
@Input() minimumDate: boolean = false;
@Input() onlyDatePicker: boolean = false;
@Output() dateChange = new EventEmitter();
import { Input, Output, EventEmitter, ViewChild, ElementRef, Directive, Renderer } from ‘@angular/core’;
declare var jQuery: any;
@Directive({
selector: ‘[myDatepicker]’
})
export class DatePicker {
@Input() value = ‘’;
@Input() minimumDate: boolean = false;
@Input() onlyDatePicker: boolean = false;
@NgModule({
imports: [
SharedModule
]
})
export class AppModule { }
@NgModule({
imports: [
SharedModule
]
})
export class AppModule { }
npm install -g @angular/cli
ng --version # Check version: @angular/cli: 1.3.0, node: 8.1.2
ng new angular-ci
cd angular-ci
ng serve
// Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
require('karma-jasmine'),
// require('karma-chrome-launcher'), /*comment out this line to disable the karma-chrome-launcher*/
/**
* 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
import { ADD_MOVIE } from './movie.actions';
import { Http, Headers, Response } from '@angular/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable()
export class MovieStore {
import { Injectable } from '@angular/core';
import { ADD_MOVIE } from './movie.actions';
import { MovieStore } from './movie.store';
@Injectable()
export class MovieReducers {
constructor(private _movieStore: MovieStore) {
}
export const ADD_MOVIE = '[MOVIE] Add';
export const REMOVE_MOVIE = '[MOVIE] Remove';