This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngFor="let element of myArray; let idx = index"> | |
<input name="someName" [(ngModel)] = "myArray[idx]"> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs/Observable'; | |
import { | |
HttpEvent, | |
HttpHandler, | |
HttpInterceptor, | |
HttpRequest | |
} from '@angular/common/http'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Angular Modules */ | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { RouterModule } from '@angular/router'; | |
import { FormsModule } from '@angular/forms'; | |
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { AppComponent } from './app.component'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core'; | |
import { HTTPStatus } from './services/RxJS/HTTPListener.service'; | |
declare var bodymovin: any; | |
@Component({ | |
selector: 'app-root', | |
template: `<div [hidden] = !HTTPActivity`, | |
styleUrls: ['./app.component.css'] | |
}) | |
export class AppComponent { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) add a button " Visibility Point Query" | |
click on this button should : | |
-disable the tilting and orbit controls of the scene | |
- capture any click on the screen and only draw the last clicked point | |
- transform window x, y to world coordinates | |
- the button is inversed to "Query visibility", click on this button sends the last clicked point to the server and shows a loader | |
2) add a button "Path Visibility" | |
clicking on this button has the same effect as previously but: | |
all points are drawn onto the scene, need to link the points between them, (draw vectors by couples of {x, y}), if the first couple and the last couple (last clicked point) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
goToServer = () => { | |
this.http.get('url'); | |
} | |
getInformtionFromService = () => { | |
service.goToServer().subscribe(result => console.log(result), error => console.log(error.message)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// set up some class with an input decorator (the one we want to watch and act upon change | |
export class MyComponent { | |
myBooleanValue: boolean; | |
@Input() | |
set myBooleanValue(newValue: boolean) { | |
// will display this message as soon as the value of 'myBooleanValue' changes | |
console.log(`old value was ${this.booleanValue}, new value is ${newValue}`; | |
this.myBooleanValue = newValue; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<my-component [myBooleanValue]="someValue"></my-component> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Pipe, PipeTransform } from '@angular/core'; | |
/* | |
* Convert bytes into largest possible unit. | |
* Takes an precision argument that defaults to 2. | |
* Usage: | |
* bytes | fileSize:precision | |
* Example: | |
* {{ 1024 | fileSize}} | |
* formats to: 1 KB |