Skip to content

Instantly share code, notes, and snippets.

View elmarputz's full-sized avatar

Elmar Putz elmarputz

  • Studio Mitte Digital Media GmbH
  • Linz, Austria
View GitHub Profile
import { Injectable } from '@angular/core';
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from "@angular/common/http";
import {Observable} from "rxjs";
@Injectable({
providedIn: 'root'
})
export class TokenInterceptorService implements HttpInterceptor {
@if(!isLoggedIn()){
<div>
<h1>Login</h1>
<form class="ui large form" [formGroup]="loginForm" (ngSubmit)="login()">
<div class="field">
<label>E-Mail</label>
<input type="email" id="username" formControlName="username">
@if(loginForm.get('username')?.invalid &&
(loginForm.get('username')?.dirty || loginForm.get('username')?.touched) &&
loginForm.get('username')?.hasError('required')){
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
export class ErrorMessage {
constructor(
public forControl: string,
public forValidator: string,
public text: string
) { }
}
export const BookFormErrorMessages = [
new ErrorMessage('title', 'required', 'Ein Buchtitel muss angegeben werden'),
new ErrorMessage('isbn', 'required', 'Es muss eine ISBN angegeben werden'),
<div class="field">
<label>Erscheinungsdatum</label>
<input type="date" formControlName="published">
@if(errors['published']){
<div class="ui negative message">{{ errors['published'] }} </div>
}
</div>
<div class="field">
<label>Beschreibung</label>
<textarea formControlName="description" rows="3"></textarea>
@if(book){
<div class="ui grid">
<div class="four wide column">
@if(book.images && book.images[0]){
<img class="ui large image" [src]="book.images[0].url">
}
</div>
<div class="twelve wide column">
<h1 class="ui header">{{ book.title }}</h1>
<h3 class="ui header">{{ book.subtitle }}</h3>
<div class="ui middle aligned selection divided list">
@for (book of books; track book) {
<a class="item">
@if(book.images && book.images[0]) {
<img class="ui tiny image" [src]="book.images[0].url"/>
}
<div class="content">
<div class="header">{{ book.title }}</div>
<div class="description"> {{ book.subtitle }} </div>
<div class="metadata">
this.books = [
new Book(1,
'9783864903571',
'Angular',
[new Author(1,'Johannes', 'Hoppe'), new Author(2,'Danny','Koppenhagen'),
new Author(3,'Ferdinand','Malcher'), new Author(4,'Gregor', 'Woiwode')],
new Date(2017, 3, 1),
1,
'Grundlagen, fortgeschrittene Techniken und Best Practices mit TypeScript - ab Angular 4, inklusive NativeScript und Redux',
5,
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers"
data-namespace-typo3-fluid="true">
<!--
=====================
Partials/List/KWMItem.html
-->
<article class="article articletype-{newsItem.type}{f:if(condition: newsItem.istopnews, then: ' topnews')}" itemscope="itemscope" itemtype="http://schema.org/Article">
<n:excludeDisplayedNews newsItem="{newsItem}"/>
<f:layout name="General" />
<!--
=====================
Templates/News/List.html
-->
<f:section name="content">
<!--TYPO3SEARCH_end-->
<f:if condition="{news}">
<f:then>