Skip to content

Instantly share code, notes, and snippets.


View GitHub Profile
View ClickOutSide.vue
// This variable will hold the reference to the document's click handler
let handleOutsideClick
// Difining clickoutside globally for the application
// so it will be used across all the components
Vue.directive('clickoutside', {
// bind the logic to the html element
bind (el, binding, vnode) {
// Here's the click/touchstart handler
// (it is registered below)
View App.vue
<div id="app">
Open Country Popup
View read-movie.component.ts
import { MovieStore } from './../';
import { Component, OnInit } from '@angular/core';
selector: 'app-read-movie',
templateUrl: './read-movie.component.html',
styleUrls: ['./read-movie.component.css']
export class ReadMovieComponent implements OnInit {
public movieList: any;
View create-movie.component.ts
import { ADD_MOVIE } from './../movie.actions';
import { MovieReducers } from './../movie.reducer';
import { MovieStore } from './../';
import { Component, OnInit, ViewChild, ElementRef } from '@angular/core';
selector: 'app-create-movie',
templateUrl: './create-movie.component.html',
styleUrls: ['./create-movie.component.css']
View movie.actions.ts
export const ADD_MOVIE = '[MOVIE] Add';
export const REMOVE_MOVIE = '[MOVIE] Remove';
View movie.reducer.ts
import { Injectable } from '@angular/core';
import { ADD_MOVIE } from './movie.actions';
import { MovieStore } from './';
export class MovieReducers {
constructor(private _movieStore: MovieStore) {
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';
export class MovieStore {
View gist:ab0bd9247705d6a6a712b2fa3ef14142
* 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
View gist:c81010186951041b668e2ad6615511d1
// Karma configuration file, see link for more information
module.exports = function (config) {
basePath: '',
frameworks: ['jasmine', '@angular/cli'],
plugins: [
// require('karma-chrome-launcher'), /*comment out this line to disable the karma-chrome-launcher*/
View Install Angular cli
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
You can’t perform that action at this time.