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 / Sass.md
Last active May 29, 2021 09:10
Sass (which stands for Syntactically Awesome Style Sheets) is an extension to CSS

Sass (which stands for Syntactically Awesome Style Sheets) is an extension to CSS.

sass is superset of css Sass is syntatic sugar of css It helps in writing CSS quickly.

SASS supports two syntaxes namely SCSS and Indented syntax

  • The SCSS - is an extension of CSS syntax. files use the extension .scss.
@rajaramtt
rajaramtt / difference between the HashLocationStrategy and PathLocationStrategy.md
Created August 31, 2019 19:56
Know the difference between the HashLocationStrategy and PathLocationStrategy.

To enable HashLocationStrategy in an Angular application we pass {useHash: true} when we are providing our routes with RouterModule, like so:

TypeScript RouterModule.forRoot(routes, {useHash: true})

http://somedomain.com/page#routing-strategies Taking a look at the app we’ve built so far, if running locally the URLs look something like:

localhost:4040/#/search localhost:4040/#/artist/1234/tracks

@rajaramtt
rajaramtt / CUSTOM_ELEMENTS_SCHEMA vs NO_ERRORS_SCHEMA in Angular8.md
Last active August 11, 2020 15:33
CUSTOM_ELEMENTS_SCHEMA vs NO_ERRORS_SCHEMA in Angular8

Including the CUSTOM_ELEMENTS_SCHEMA in the module allows the use of the web components in the HTML markup without the compiler producing errors

  • Defines a schema that allows an NgModule to contain the following:
    • Non-Angular elements named with dash case (-).
    • Element properties named with dash case (-).
  • Dash case is the naming convention for custom elements.
@rajaramtt
rajaramtt / media-query.css
Created August 9, 2019 11:07 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@rajaramtt
rajaramtt / object into query string parameters in JavaScript.js
Created June 28, 2019 14:03
object into query string parameters in JavaScript
var params = {
a: 1,
b: 2,
c: 3
};
var queryString = Object.keys(params).map(key => key + '=' + params[key]).join('&');
// or
var queryString = Object.keys(params).map(function(key) {
@rajaramtt
rajaramtt / angular-configuring.md
Created May 29, 2019 07:16
Configuring application environments

environments ├── environment.staging.ts

angular.json

"configurations": {

"staging": { "fileReplacements": [

@rajaramtt
rajaramtt / angular.json
Last active September 10, 2019 11:58
Stage environment setup in angular
"configurations": {
"production": { ... },
"staging": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
]
}
@rajaramtt
rajaramtt / ElementRef, TemplateRef, ViewRef, ComponentRef and ViewContainerRef.ts
Last active October 22, 2023 17:26
ElementRef, TemplateRef, ViewRef, ComponentRef and ViewContainerRef
//--------------- ElementRef----------------------
@ViewChild('foo', {static: false}) foo: ElementRef;
@Component({
selector: 'sample',
template: `
@rajaramtt
rajaramtt / RxJS Operators.txt
Created March 31, 2019 20:15
RxJS Operators
Combination Operators
---------------------------------
combineAll
combineLatest :star:
concat :star:
concatAll
forkJoin
merge :star:
mergeAll
pairwise
@rajaramtt
rajaramtt / Observable, Subject, BehaviorSubject, ReplaySubject and AsyncSubject .txt
Last active March 31, 2019 20:08
Observable, Subject, BehaviorSubject, ReplaySubject and AsyncSubject
Observable: Subscribe to it to get the values
Subject: Same but you also have control of the values that you want to emit into it (can subscribe to it but also emit)
ReplaySubject:
Same as subject but will keep track of the N latest emitted values and every time you subscribe to it,
it'll emit those N values
BehaviorSubject:
Subject where you have to set a default value,
if you subscribe to it before anything has been emitted you'll get the default value