This file contains 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 { isType } from './typeguardHelper'; | |
import { Car, carRuleSet, Engine, engineRuleSet, Wheel, wheelRuleSet } from './Car'; | |
const mockEngine: Engine = { | |
cylinders: 8, | |
maxSpeed: 7400, | |
fuelType: 'diesel' | |
}; | |
const mockWheel: Wheel = { |
This file contains 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
<mat-table #table [dataSource]="dataSource" matSort (matSortChange)="onSortData($event)"> | |
<!-- Address Column --> | |
<ng-container matColumnDef="address"> | |
<mat-header-cell class="table-address-column" *matHeaderCellDef mat-sort-header> Address </mat-header-cell> | |
<mat-cell class="table-address-column" *matCellDef="let element"> {{element.address}} </mat-cell> | |
</ng-container> | |
<!-- Beds Column --> | |
<ng-container matColumnDef="beds"> | |
<mat-header-cell *matHeaderCellDef mat-sort-header> Beds </mat-header-cell> |
This file contains 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 MonetaryInputCtrl($scope, $timeout) { | |
$scope.updated = true; | |
$scope.value = '$0.00'; | |
$scope.$watch('value', function (value) { | |
$timeout(function () { | |
if (!$scope.updated) { | |
if (!value.match(/\$[0-9]+\.[0-9]?[0-9]?[0-9]$/g)) { | |
value = '$0.00'; | |
} | |
console.log("update = " + $scope.updated + " : " + value); |