Skip to content

Instantly share code, notes, and snippets.

View rajaramtt's full-sized avatar
🤘
Learning and Sharing

Raja Ram T rajaramtt

🤘
Learning and Sharing
  • Hyderabad, India
View GitHub Profile
@rajaramtt
rajaramtt / ng build base-href
Last active April 7, 2019 07:51
ng build base-href
ng build --base-href /mockup/
@rajaramtt
rajaramtt / map-example-in-angular7.ts
Created December 17, 2018 13:58
Observable map key example
import { Observable, BehaviorSubject, ReplaySubject, pipe } from 'rxjs';
import { of as observableOf } from 'rxjs';
import { tap, map } from 'rxjs/operators';
import { distinctUntilChanged } from 'rxjs/operators';
return this.http.post(`${environment.host}${environment.loginService}`, credentials)
.pipe(
map(response => {
const storage = sessionStorage;
@rajaramtt
rajaramtt / angular-query-string-and-parameters-example.ts
Last active August 21, 2020 11:00
Angular Query string and parameters example
import { Router, ActivatedRoute, Params } from '@angular/router';
constructor(
private router: Router,
private route: ActivatedRoute,
) { }
@rajaramtt
rajaramtt / nginx
Created November 27, 2018 12:37
nginx angular and node proxy config
server {
listen 80;
server_name 0.0.0.0;
root /var/www/html/dist;
index index.html index.htm;
@rajaramtt
rajaramtt / cors.js
Created October 31, 2018 13:31
CORS headers in node, php
app.use(function (req, res, next) {
res.setHeader('Access-Control-Allow-Origin', 'http://localhost:4200');
res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
res.setHeader('Access-Control-Allow-Credentials', true);
next();
@rajaramtt
rajaramtt / PromiseCode.ts
Last active July 22, 2021 15:30
Promise Code in JS
testFun(): void {
this.testPromise(identity).then(data => {
}).catch(function (e) {
console.log(e);
});