Skip to content

Instantly share code, notes, and snippets.

View huytrongnguyen's full-sized avatar

Huy Trong Nguyen huytrongnguyen

View GitHub Profile

Episode 1: The Beginning of the World

Origin of the world The beginning of the world In the past only light and darkness. The two powers were formed into two gods: Deva, the god of light and Okuras, the god of darkness. The battle of the two takes place on Earth. But at the end of the last fight The God of Light successfully used the power to seal Okuras. But Deva's power was lost and scattered to different places on Earth to maintain balance.

Deva Deva, God of Light

10000 years BC Everlasting darkness Man was born on earth. The "Hell of the Abyss" was born and received part of the power of human death. But humans are wicked and increasing day by day. Human vices have made the "Hell of Abyss" more and more powerful, eventually covering the world with darkness. But at the end of the last fight The God of Light successfully used the power to seal Okuras. But Deva's power was lost and scattered to the rest of the world. 10000 BC Bretera, the life of the p

@huytrongnguyen
huytrongnguyen / ajax.js
Created June 21, 2018 12:06
Ajax promise with Observable.ajax
import { Observable } from 'rxjs';
class Ajax {
request({ url, method = 'get', responseType = 'json', params }) {
return new Promise((resolve, reject) => {
Observable.ajax({
url,
method,
headers: { 'Content-Type': 'application/json' },
body: method === 'post' && params,
import 'zone.js';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);
├── src/
│ ├── app.component.html
│ ├── app.component.js
│ ├── app.module.js
│ ├── app.js
└── index.html
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [
BrowserModule,
],
declarations: [
AppComponent,
import { Component } from '@angular/core';
import template from './app.component.html';
@Component({
selector: 'my-app',
template,
})
export class AppComponent {
constructor() {
this.title = 'Tour of Heroes';
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Angular Demo</title>
</head>
<body>
<my-app></my-app>
<script src="dist/js/vendor.js"></script>
import path from 'path';
import webpack from 'webpack';
import ExtractTextPlugin from 'extract-text-webpack-plugin';
export default {
devtool: 'inline-source-map',
entry: {
'js/vendor': [
'@angular/common',
'@angular/compiler',
{
"name": "angular-demo",
"version": "5.2.9",
"scripts": {
"build": "webpack",
"serve": "webpack && webpack-dev-server --hot --inline --open"
},
"babel": {
"presets": [ "env" ],
"plugins": [