{"id":49,"date":"2019-10-10T09:57:35","date_gmt":"2019-10-10T09:57:35","guid":{"rendered":"https:\/\/docs.theironnetwork.org\/angly\/?page_id=49"},"modified":"2019-10-15T09:07:27","modified_gmt":"2019-10-15T09:07:27","slug":"routing-navigation","status":"publish","type":"page","link":"https:\/\/docs.theironnetwork.org\/angly\/routing-navigation\/","title":{"rendered":"Routing\/Navigation"},"content":{"rendered":"\n<p> 1. Go to src &gt;&gt; app &gt;&gt; and open app.routing.ts file and add routing like this:-<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{ path: 'about\/:keyword',component: AboutComponent }<br><\/pre>\n\n\n\n<p>For Reference: <a href=\"https:\/\/angular.io\/guide\/router\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/angular.io\/guide\/router<\/a><\/p>\n\n\n\n<p> 2. If you want to use this routing in component then go to src &gt;&gt; app &gt;&gt;  and open component.ts file then do the followings:- <\/p>\n\n\n\n<p>a) Add the the routing at top of the file like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import { Router} from '@angular\/router';<br>constructor(private router: Router){}<\/pre>\n\n\n\n<p> b) Add in your desire component and add these line of code in your function:- For Example:-<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">gotoAbout(){<br>  this.router.navigate(['\/about'], { queryParams: { keyword: 'Test' } });<br>}<br><\/pre>\n\n\n\n<p> For Reference :-  <a href=\"https:\/\/alligator.io\/angular\/query-parameters\/\">https:\/\/alligator.io\/angular\/query-parameters\/<\/a><br><\/p>\n<div class=\"pld-like-dislike-wrap pld-template-1\">\n    <div class=\"pld-like-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-like-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"49\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-ip-check=\"0\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-up\"><\/i>\n                    <\/a>\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\n<\/div><div class=\"pld-dislike-wrap  pld-common-wrap\">\n    <a href=\"javascript:void(0);\" class=\"pld-dislike-trigger pld-like-dislike-trigger \" title=\"\" data-post-id=\"49\" data-trigger-type=\"dislike\" data-ip-check=\"0\" data-restriction=\"cookie\" data-user-check=\"1\">\n                        <i class=\"fas fa-thumbs-down\"><\/i>\n                    <\/a>\n    <span class=\"pld-dislike-count-wrap pld-count-wrap\"><\/span>\n<\/div><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>1. Go to src &gt;&gt; app &gt;&gt; and open app.routing.ts file and add routing like this:- { path: &#8216;about\/:keyword&#8217;,component: AboutComponent } For Reference: https:\/\/angular.io\/guide\/router 2. If you want to use this routing in component then go to src &gt;&gt; app &gt;&gt; and open component.ts file then do the followings:- a) Add the the routing at [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/pages\/49"}],"collection":[{"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/comments?post=49"}],"version-history":[{"count":7,"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/pages\/49\/revisions"}],"predecessor-version":[{"id":159,"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/pages\/49\/revisions\/159"}],"wp:attachment":[{"href":"https:\/\/docs.theironnetwork.org\/angly\/wp-json\/wp\/v2\/media?parent=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}