Angular 2 get routeParams in a service
问题 I want to shift the logic from component to service. But I found out that I can't get the routeParams in a service. My component looks like import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Params } from '@angular/router'; import { MyService } from '../services/my.service'; @Component({ moduleId: module.id, templateUrl: 'my.component.html', styleUrls: ['my.component.css'] }) export class MyComponent implements OnInit { constructor(private myService: MyService,