Skip to content

Instantly share code, notes, and snippets.

@alxhub
Created October 3, 2018 17:53
Show Gist options
  • Save alxhub/7b95fa636d57e9b11e880077999a7c7d to your computer and use it in GitHub Desktop.
Save alxhub/7b95fa636d57e9b11e880077999a7c7d to your computer and use it in GitHub Desktop.
function ToDoAppComponent_TypeCheckBlock(ctx: ToDoAppComponent) { if (true) {
var _t1 = document.createElement("section");
var _t2 = document.createElement("header");
var _t3 = document.createElement("h1");
var _t4 = document.createElement("input");
_t4.value = ctx.newTodoText;
var _t5: any = (null!);
var _t6 = _i0.NgIf.ngTypeCtor({ ngIf: ctx.todoStore.todos.length > 0 });
_t6.ngIf = ctx.todoStore.todos.length > 0;
if (_i0.NgIf.ngTemplateGuard_ngIf(_t6, ctx.todoStore.todos.length > 0)) {
var _t7 = document.createElement("section");
var _t8: any = (null!);
var _t9 = _i0.NgIf.ngTypeCtor({ ngIf: ctx.todoStore.todos.length });
_t9.ngIf = ctx.todoStore.todos.length;
if (_i0.NgIf.ngTemplateGuard_ngIf(_t9, ctx.todoStore.todos.length)) {
var _t10 = document.createElement("input");
_t10.checked = ctx.todoStore.allCompleted();
}
var _t11 = document.createElement("ul");
var _t12: any = (null!);
var _t13 = _i0.NgForOf.ngTypeCtor({ ngForOf: ctx.todoStore.todos });
_t13.ngForOf = ctx.todoStore.todos;
if (_i0.NgForOf.ngTemplateContextGuard(_t13, _t12)) {
var _t14 = document.createElement("li");
var _t15 = document.createElement("div");
var _t16 = document.createElement("input");
var _t17 = _t12.$implicit;
_t16.checked = _t17.completed;
var _t18 = document.createElement("label");
_t17.title;
var _t19 = document.createElement("button");
var _t20: any = (null!);
var _t21 = _i0.NgIf.ngTypeCtor({ ngIf: _t17.editing });
_t21.ngIf = _t17.editing;
if (_i0.NgIf.ngTemplateGuard_ngIf(_t21, _t17.editing)) {
var _t22 = document.createElement("input");
_t22.value = _t17.title;
}
}
}
var _t23: any = (null!);
var _t24 = _i0.NgIf.ngTypeCtor({ ngIf: ctx.todoStore.todos.length > 0 });
_t24.ngIf = ctx.todoStore.todos.length > 0;
if (_i0.NgIf.ngTemplateGuard_ngIf(_t24, ctx.todoStore.todos.length > 0)) {
var _t25 = document.createElement("footer");
var _t26 = document.createElement("span");
var _t27 = document.createElement("strong");
ctx.todoStore.getRemaining().length;
(ctx.todoStore.getRemaining().length == 1 ? "item" : "items");
var _t28: any = (null!);
var _t29 = _i0.NgIf.ngTypeCtor({ ngIf: ctx.todoStore.getCompleted().length > 0 });
_t29.ngIf = ctx.todoStore.getCompleted().length > 0;
if (_i0.NgIf.ngTemplateGuard_ngIf(_t29, ctx.todoStore.getCompleted().length > 0)) {
var _t30 = document.createElement("button");
}
}
} }
<section class="todoapp">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus=""
[value]="newTodoText"
(keyup)="$event.code == 'Enter' ? addTodo() : updateNewTodoValue($event.target.value)">
</header>
<section *ngIf="todoStore.todos.length > 0" class="main">
<input *ngIf="todoStore.todos.length"
#toggleall class="toggle-all" type="checkbox"
[checked]="todoStore.allCompleted()"
(click)="toggleAllTodos(toggleall.checked)">
<ul class="todo-list">
<li *ngFor="let todo of todoStore.todos"
[class.completed]="todo.completed"
[class.editing]="todo.editing">
<div class="view">
<input class="toggle" type="checkbox"
(click)="toggleCompletion(todo)"
[checked]="todo.completed">
<label (dblclick)="editTodo(todo)">{{todo.title}}</label>
<button class="destroy" (click)="remove(todo)"></button>
</div>
<input *ngIf="todo.editing"
class="edit" #editedtodo
[value]="todo.title"
(blur)="updateEditingTodo(todo, editedtodo.value)"
(keyup)="updateEditedTodoValue($event.target.value)"
(keyup)="$event.code == 'Enter' && updateEditingTodo(todo, editedtodo.value)"
(keyup)="$event.code == 'Escape' && cancelEditingTodo(todo)">
</li>
</ul>
</section>
<footer *ngIf="todoStore.todos.length > 0" class="footer">
<span class="todo-count">
<strong>{{todoStore.getRemaining().length}}</strong>
{{todoStore.getRemaining().length == 1 ? 'item' : 'items'}} left
</span>
<button *ngIf="todoStore.getCompleted().length > 0"
class="clear-completed"
(click)="removeCompleted()">
Clear completed
</button>
</footer>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment