angularnotes's People
angularnotes's Issues
https://blog.angularindepth.com/angular-flex-layout-flexbox-and-grid-layout-for-angular-component-6e7c24457b63
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]
});
Notes
Unit Testing
SQL Vs NOSQL
NOSQL VS SQL
- Insertion and Retrivals are a chuck of data, and is picked up in a single instance - instead fo joining shits
- Schema is easily changeable.
- Build for Scale - Horintal Partitonal
- 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..
reactive forms 2
Getting Events as Observables
Prevent Objects from mutating in JavaScript
@input() set item(value.Item) {
if(value) { this.originalName = value.Name }
this.selectedItem = Object.assign({}, value);
}
Angular Providers
Providers provided in the module level are singleton
Providers provided in the component level are created for every instances of the component.
async pipe not to hit the Observable<> often from service layer
*ngIf="courses$ | async as courses else ngtemplate
<ng template #templateName>
Angular Testing
Angular Forms Notes
Screenshots Notes
Node.JS global stuffs
console.log()
setTimeOut()
clearTimeOut()
setInterval()
clearInterval()
https://medium.com/frontend-fun/angular-introduction-to-internationalization-i18n-28226a85e04e
good angular stuffs
How to get started with routing
RouterModule.forRoot([
{path: ‘’, component: ComponentName }
{path:’profile/:userId’, component: GitHub}
{path:’**’, component: GitHub}
]);
Order Matters
- Configure Route
- Add Routlet -> Elements are rendered after the outlet
<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
}
);
action in TS
Angular Testing Tip
Reactive Forms in Angular
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.