<file_sep>import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { OsobaComponent } from './osoba/osoba.component';
import { AutoComponent } from './auto/auto.component';
import { TestComponent } from './test/test.component';
import { OsobaEditComponent } from './osoba-edit/osoba-edit.component';
import { OsobaListComponent } from './osoba-list/osoba-list.component';

@NgModule({
  declarations: [
    AppComponent,
    OsobaComponent,
    AutoComponent,
    TestComponent,
    OsobaEditComponent,
    OsobaListComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
<file_sep>export class Osoba {
  public Id: number;
  public Meno: string;
  public Priezvisko: string;

  constructor(Id: number, Meno: string, Priezvisko: string) {
    this.Id = Id;
    this.Meno = Meno;
    this.Priezvisko = Priezvisko;
  }
}

export class Auto {
  public Id: number;
  public Ecv: string;
  public Poznamka: string;

  constructor(Id: number, Ecv: string, Poznamka: string) {
    this.Id = Id;
    this.Ecv = Ecv;
    this.Poznamka = Poznamka;
  }
}
<file_sep>import { Component } from '@angular/core';
import { Osoba } from '../app.model';

@Component({
  selector: 'app-osoba',
  templateUrl: './osoba.component.html',
  styleUrls: ['./osoba.component.css']
})
export class OsobaComponent {
  osoba: Osoba = new Osoba(-1, 'Miška', 'Bačíková');
}
<file_sep>import { Component } from '@angular/core';
import { Osoba } from '../app.model';

@Component({
  selector: 'app-osoba-list',
  templateUrl: './osoba-list.component.html',
  styleUrls: ['./osoba-list.component.css']
})
export class OsobaListComponent {
  osoby: Osoba[] = [
    new Osoba(-1, 'Miška', 'Bačíková'),
    new Osoba(-1, 'Tomáš', 'Čižmár'),
    new Osoba(-1, 'Stano', 'Zavila'),
    new Osoba(-1, 'Martinka', 'Révayová')
  ];
}
<file_sep>import { Component } from '@angular/core';
import { Osoba } from '../app.model';

@Component({
  selector: 'app-osoba-edit',
  templateUrl: './osoba-edit.component.html',
  styleUrls: ['./osoba-edit.component.css']
})
export class OsobaEditComponent {
  osoba: Osoba = new Osoba(-1, 'Miška', 'Bačíková');

  osobaToString(): string {
    // return this.osoba.Id + '. ' + this.osoba.Meno + ' ' + this.osoba.Priezvisko;

    return `${this.osoba.Id}. ${this.osoba.Meno} ${this.osoba.Priezvisko}`;
  }
}
<file_sep>import { Component } from '@angular/core';

@Component({
  selector: 'app-test',
  template:  `
    Obsah premennej: {{premenna}}
    <input type="text" [(ngModel)]="premenna">
  `,
  styleUrls: ['./test.component.css']
})
export class TestComponent {
  premenna = 'daco';
}
