Skip to content
Snippets Groups Projects
Commit 90ccd37d authored by Jesper's avatar Jesper
Browse files

Fix crash when displaying ASTNode

parent 6ef48806
Branches
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ import {AstDecl} from './ast-decl';
`],
template: `
<p *ngIf="decl">JastAdd production: <br>
<div class="ast-decl">{{decl.name}}: <type-ref [type]="decl.extends"></type-ref><!--
<div class="ast-decl">{{decl.name}}<ng-container *ngIf="decl.extends">: <type-ref [type]="decl.extends"></type-ref></ng-container><!--
--><ng-container *ngIf="decl.components"> ::= <!--
--><ng-container *ngFor="let comp of decl.components"><!--
--><div class="ast-component"><!--
......
......@@ -3,7 +3,7 @@ import {AstComponent} from './ast-component';
export class AstDecl {
name: string;
extends: TypeRef;
extends?: TypeRef;
components?: AstComponent[];
static fromJson(json: any): AstDecl {
......
......@@ -18,11 +18,11 @@ import { MemberFilterService } from './member-filter.service';
color: #444;
}
`],
template: `<a *ngIf="type.id; else elseBlock" class="usertype" [routerLink]="['/type', type.id]" (click)="onClick()">{{getName()}}</a><!--
template: `<ng-container *ngIf="type;else notype"><a *ngIf="type.id; else elseBlock" class="usertype" [routerLink]="['/type', type.id]" (click)="onClick()">{{getName()}}</a><!--
--><ng-template #elseBlock><span class="non-usertype">{{getName()}}</span></ng-template><!--
--><ng-container *ngIf="type.args && !name"><!--
-->&lt;<ng-container *ngFor="let arg of type.args; let isLast=last"><type-ref [type]="arg"></type-ref><div *ngIf="!isLast" class="sep">,</div></ng-container>&gt;<!--
--></ng-container>`
--></ng-container></ng-container><ng-template #notype>Unknown Type</ng-template>`
})
export class TypeReferenceComponent {
@Input() type : Type;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment