Skip to content

Instantly share code, notes, and snippets.

View nifrasismail's full-sized avatar
🏁
MicroService Based API Developer

Nifras Ismail nifrasismail

🏁
MicroService Based API Developer
View GitHub Profile
<form
#signupForm="ngForm"
(ngSubmit)="registerUser(signupForm)">
<label>
Username:
<input type="text" name="username" ngModel />
</label>
<label>
import { NgModule } '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component'
@NgModule({
imports: [
BrowserModule,
FormsModule
[
{
"name" : "",
"name_ta" : "Dinakaran",
"links" : [
{
"name" : "Just Now - Hot News",
"link" : "http://www.dinakaran.com/rss_Latest.asp"
},
{
import {Component, OnInit} from "@angular/core";
import {Title} from "../title";
import {Connected} from "../connected";
import {Customer} from "../customer";
import {AppServiceService} from "../../_services/app-service.service";
import {AlertService} from "../../_services/alert.service";
import {Router, ActivatedRoute} from "@angular/router";
@Component({
selector: 'app-customer-create',
type = ['','info','success','warning','danger'];
function notifyMe(from, align){
color = Math.floor((Math.random() * 4) + 1);
$.notify({
icon: "notifications",
message: "Welcome to <b>Material Dashboard</b> - a beautiful freebie for every web developer."
},{
// Base Class : ES6
class Bird {
constructor(weight, height) {
this.weight = weight;
this.height = height;
}
walk() {
console.log('walk!');
}
}
incremetedItems = items.map(function(x){
return x+1;
});
/* This is convert as a simple function as follow */
incremetedItems = items.map((x) => x+1);
items.forEach(function(x){
console.log(x);
incrementedItems.push(x+1);
});
/* After Applied Arrow Functions */
items.forEach((x) => {
console.log(x);
incrementedItems.push(x+1);
});
class ServerRequest{
notify(){
// Implementation of notify()
}
fetch(){
getFromSerer(function callback(err,data){
this.notify(); // This is not going to work as expected.
// It is producing undefined object error on console if you log the object
}
class Toppings{
formatToppings{
/* Implemetation of Toppings */
}
list(){
return this.formatToppings(this.toppings);
}
}