Angular2 using @Inputs with s

前端 未结 4 932
我寻月下人不归
我寻月下人不归 2020-12-03 04:40

I have a sub-navigation in my page that displays some subviews below a common main view. I would like to pass an object to the subviews through the

4条回答
  •  北海茫月
    2020-12-03 04:43

    Looks like syntax has been changed. Below works for me ~Angular4.0.0

    HTML (Pass Route Parameters)

  • New Job
  • Component

    constructor(private route: ActivatedRoute) { }
    
    ngOnInit() {       
      this.getTemplate();
    
      this.sub = this.route.params.subscribe(params => { this.id = params['mode'];
      console.log("Routing Mode", this.id);    
      });
    }
    

提交回复
热议问题