aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/src/app/app.component.ts
blob: 6e66e308b41b6232d593cd5398c99068a2eab54d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { Component } from '@angular/core';
import { NgModel } from '@angular/forms';
import { Router } from '@angular/router';
import { Serve1Service } from './serve1.service';//

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'project';
  a = 0;
  b = 0;
  Sum = "";


  constructor(private serve1: Serve1Service, private router: Router) { } //
  
  sumNumbers() {
    console.log(this.a + ':' + this.b);
    // za slanje back-u, subscribe - asinhrono
    this.serve1.sendNumbers(this.a, this.b).subscribe((serviceSum) => {
      console.log(serviceSum);
      this.Sum = serviceSum;
    })
  }
}