• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Angular 2 Development with TypeScript: Question about importing rxjs

 
Ranch Hand
Posts: 90
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read a blog article which discusses how to use the Title service and listen to router events in order to change the page title when the user navigates to another path: https://toddmotto.com/dynamic-page-titles-angular-2-router-events

The article talks about using some features of RxJs and that the sample code requires the following imports:



Indeed, I found that this code sample from the article does not work without importing mergeMap:



The result of the filter() call has type Observable<ActivatedRoute>.

How can importing 'rxjs/add/operator/mergeMap' affect the methods that are available on the Observable type? Does TypeScript have a feature similar to C#'s extension methods?

I saw the Suggestion: Extension methods issue on GitHub, but from one of the comments, it appears that extension methods were not implemented: https://github.com/Microsoft/TypeScript/issues/9#issuecomment-236459998

Is that correct?
reply
    Bookmark Topic Watch Topic
  • New Topic