Skip to content

Instantly share code, notes, and snippets.

@Nathan-Nesbitt
Created June 18, 2020 17:47
Show Gist options
  • Save Nathan-Nesbitt/4caf4856b6bc12b65389136673b73e2b to your computer and use it in GitHub Desktop.
Save Nathan-Nesbitt/4caf4856b6bc12b65389136673b73e2b to your computer and use it in GitHub Desktop.
Uses the newly created Service Function
import { Component, OnInit } from '@angular/core';
import { ExampleServiceService } from '../example-service.service';
@Component({
selector: 'app-component-example',
templateUrl: './component-example.component.html',
styleUrls: ['./component-example.component.css']
})
export class ComponentExampleComponent implements OnInit {
value: number = 0;
constructor(service:ExampleServiceService) {
this.value = service.myTestFunction(1, 2, 3, 4);
}
ngOnInit() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment