daily pastebin goal
11%
SHARE
TWEET

Untitled

a guest May 17th, 2018 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { MyDataService } from './services/my-data.service';
  2. constructor(private posting: MyDataService
  3.   ) {}
  4.  
  5.   ngOnInit() {
  6.     this.posting.postMethod().subscribe(
  7.     (response => {
  8.       console.log(response)
  9.     }));
  10. }
  11. }
  12.    
  13. @Injectable()
  14.  
  15. export class MyDataService {
  16.  
  17.   constructor(private http: Http)
  18.   { }
  19.  
  20.  
  21.  postMethod(model: any  ) {
  22.     return this.http.post("http ://", model)
  23.       .map(res => res.json());
  24.   }
  25. }
RAW Paste Data
Top