Git Product home page Git Product logo

angularnotes's People

Watchers

 avatar

angularnotes's Issues

good angular stuffs

How to get started with routing

RouterModule.forRoot([
{path: ‘’, component: ComponentName }
{path:’profile/:userId’, component: GitHub}
{path:’**’, component: GitHub}
]);

Order Matters

  1. Configure Route
  2. Add Routlet -> Elements are rendered after the outlet
Use PropertyBinding

<a [routerLink]=“[‘route’, ha, ha]”>
routerLinkActive

GETTING ROUTE PARAMETRS:
Private route: ActivatedRoute
This.route.paramMap
Convert string to number, let foo = +params.get(id);
Why route parameters are Observable<>
If we want to take query
this.route.paramQueryMap.subscribe

COMPONENT LIFECYCLE HOOKS
Component to Component - NgOnInit won’t be loaded.

Merge Two Observables using combineLatest factory Method
Import ‘rxjs/add/observable/combineLatest’

Let obs = Observable.combineLatest([
Observable1, observable2
])

Obs.subscribe()

Better cleaner way to do avoid nested subscribe calls => SwitchMap
Also, subscribe inside subscribe causes non-sense, cos it won’t be unsubscribed.

Obs1.switchMap(
Event => {
return obs2
}
);

SQL Vs NOSQL

NOSQL VS SQL

  1. Insertion and Retrivals are a chuck of data, and is picked up in a single instance - instead fo joining shits
  2. Schema is easily changeable.
  3. Build for Scale - Horintal Partitonal
  4. Build for Aggregation as well - getting intelligent data.

Lots’ fo updates are shit and weird in NOSQL Database
Data Consistency is not good, two different nodes mayn’t have the same data.
SQL has ACID to give you consistent data.
NOSQL are not read optimised for reading particular column
Relationships are hard to find.
Joins are hard.

WHEN DO WE USE NOSQL..

Angular Providers

Providers provided in the module level are singleton
Providers provided in the component level are created for every instances of the component.

Routers Testing

it(‘should have a router outlet’, () => {
fixture.debugElement.query(By.directive(RouterDirective);
expect(de).not.tobeNull();
});

Import { RouterTestingModule } from ‘@angular/router/testing’; // This is a routing module specifically designed for testing - it’s simplified and recouped from the browser.

Imports: Rout………

it(‘should have a link to todos page’, () => {
fixture.debugElement.query(By.directive(RouterLinkWithHref)); // Not necessary the first element in the list. So use queryAll

Let debugElements = fixture.debugElement.queryAll();

—>
Let index = debugElements.findIndex (de => de.properties[‘href’] === ‘/todos’);
expect(index).toBeGreaterThan(-1);
});

VERY VERY VERY IMPORTANT
In Test Bed Configuration,
TestBed.configureTestingModuel({
Schemas: [NO_ERRORS_SCHEMA]
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.