Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Argument passed in must be a single String of 12 bytes or a string of 24 hex characters
- ngOnInit():void{
- this.route.params.subscribe(params => console.log(params['id']));
- this.route.params.switchMap((params: Params) => this.noteService.getSingleNote(params['id']))
- .subscribe(note=> this.note = note);
- }
- getSingleNote(id:string){
- return this.http.get('http://localhost:3000/api/note/:id')
- .map(res=>res.json());
- }
- router.get('/note/:id', function(req, res, next){
- db.stories.findOne({_id: mongojs.ObjectId(req.params.id)},function(err, story){
- if(err){
- res.send(err);
- }
- res.json(story);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement