Navigate to another page with a button in angular 2

前端 未结 7 1090
天命终不由人
天命终不由人 2020-12-12 18:00

I am trying to navigate to a another page by clicking a button but it fails to work. What could be the problem. I am now learning angular 2 and it\'s a bit tough for me now.

7条回答
  •  星月不相逢
    2020-12-12 18:13

    It is important that you decorate the router link and link with square brackets as follows:

     
    

    Where "/service" in this case is the path url specified in the routing component.

提交回复
热议问题