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
/* You can add global styles to this file, and also import other style files */ | |
.cdk-overlay-container { | |
display: block; | |
&.z-index-top { | |
z-index: 2050; | |
} | |
} | |
.duplicate-modal-overlay { |
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
<!-- USAGE --> | |
<!-- Transoforming strings --> | |
<div class="users"> | |
<div class="users__user" *ngFor="let user of users"> | |
{{user.name | appTitleCase}} | |
</div> | |
</div> | |
<!-- Transforming Arrays --> |
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
function evaluatePrice(vehicle: Vehicle) { | |
switch(vehicle.vType) { | |
case "car": | |
return vehicle.transmission * evaluationFactor; | |
case "truck": | |
return vehicle.capacity * evaluationFactor; | |
case "motorcycle": | |
return vehicle.make * evaluationFactor; | |
case "bicycle": | |
return vehicle.make * evaluationFactor; |
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
function evaluatePrice(vehicle: Vehicle) { | |
switch(vehicle.vType) { | |
case "car": | |
return vehicle.transmission * evaluationFactor; | |
case "truck": | |
return vehicle.capacity * evaluationFactor; | |
case "motorcycle": | |
return vehicle.make * evaluationFactor; | |
default: | |
const invalidVehicle: never = vehicle; |
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
interface IBicycle { | |
vType: "bicycle"; | |
make: number; | |
} | |
type Vehicle = IMotorcycle | ICar | ITruck | IBicycle; |
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
function evaluatePrice(vehicle: Vehicle) { | |
switch(vehicle.vType) { | |
case "car": | |
return vehicle.transmission * evaluationFactor; | |
case "truck": | |
return vehicle.capacity * evaluationFactor; | |
case "motorcycle": | |
return vehicle.make * evaluationFactor; | |
} | |
} |
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
const evaluationFactor = Math.PI; // some global factor | |
function evaluatePrice(vehicle: Vehicle) { | |
return vehicle.capacity * evaluationFactor; | |
} | |
const myTruck: ITruck = {vType: "truck", capacity: 9.5}; | |
evaluatePrice(myTruck); |
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
type Vehicle = IMotorcycle | ICar | ITruck; |
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
enum CarTransmission { | |
Automatic = 200, | |
Manual = 300 | |
} | |
interface IMotorcycle { | |
vType: "motorcycle"; // discriminant | |
make: number; // year | |
} |
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 { BehaviorSubject, Observable } from 'rxjs'; | |
export interface LoggerConfig { | |
prefix?: string; | |
color?: string; | |
enabled: boolean; | |
} | |
@Injectable({ |