Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { MyDataService } from './services/my-data.service';
- constructor(private posting: MyDataService
- ) {}
- ngOnInit() {
- this.posting.postMethod().subscribe(
- (response => {
- console.log(response)
- }));
- }
- }
- @Injectable()
- export class MyDataService {
- constructor(private http: Http)
- { }
- postMethod(model: any ) {
- return this.http.post("http ://", model)
- .map(res => res.json());
- }
- }
Add Comment
Please, Sign In to add comment