I'm trying to read a variable from the URL in Angular.

I have this in my routes

```
const routes: Routes = [
  { path: ':page', component: BlogComponent}
];

```

and this in my blog components constructor.

```
this.route.paramMap.subscribe(params => {
  const page = params.params.page;
  cacheService
    .getAllPostIds()
    .subscribe(postIds => this.loadPage(cacheService, postIds, page)
  );
});

```

This works if there is a paramater, ie `www.url.com/1` returns page = 1.

If there is nothing after the url (just `www.url.com`), this however **never** triggers the route subscription. Is this the proper way to subscribe to url variables and changes, if not how should I do it, if it is, how do I make it work even if with just a blank url `/`