I need to pass a property from my component to the RouteData class.
@Component({
selector: 'profile',
templateUrl: 'profile.html',
})
@RouteConfig([
{path:'/posts', name: 'ProfilePosts', component: ProfileTracksComponent, data: {user}, useAsDefault: true}
])
export class ProfileComponent implements OnInit {
user = {...}
I am trying to get the user
property into the RouteData (see the data
property in RouteConfig), however angular2 says that user is not defined. this.user
does not work either.
How can I do this?