Great videos! Just one question about this one. It doesn't seem a good practice to pass parameter back like shown in the video as the URL should be cleaned for SEO reasons so I wonder if there is another way to do it. Thanks for your time!
@0GRANATE06 жыл бұрын
Angular + SEO = horror
@tharindu795 жыл бұрын
Why would you do a null check then assign null when it's null anyway?
@nasrihaithem95294 жыл бұрын
was going to ask same question lol
@sabaoonullahn48193 жыл бұрын
@@nasrihaithem9529 I think that's because you can go with next to more than the ids that we have in the department list.
@iyakfishing29176 жыл бұрын
Great info!! Full of great practices!! But I've been using the routerLink to navigate back in pages which works fine, and easy but is this not good practice?
@chhotiBacchiNamHai4 жыл бұрын
I did this but the color did not change. Don't understand what is wrong with the code.
@devenshah36533 жыл бұрын
same here but no help from Vishwas !
@adnankhuwaja12343 жыл бұрын
same issue
@lorem3493 жыл бұрын
Exactly having the same issue
@ragahavavani36632 жыл бұрын
Same problem
@shaiknayeemuddinjaffree13032 жыл бұрын
same issue..color didn't change😢
@another-day-20244 жыл бұрын
@Codevolution : how to hide the optional parameters from url i.e. It does not look great to have ';id' in the URL.
@juanjoseramirezcalderon26185 жыл бұрын
Hi, I'm very new to Angular. Why are the URL params separated by a semicolon ( .../departments;id=2;test=testvalue ) ? I would expect it to be separated with commas and after a question mark (.../departments?id=2,test=testvalue). Is that the Angular way or something like that? Does it make a difference? Is it possible to use the question mark syntax way in the URL with Angular? I think there's something called , why is it not used here?
@sajansjoseph5 жыл бұрын
First of all, its not comma, its & symbol used in normal URL (For server side languages)... Angular is not server side framework... all url requests are parsed and translated by local javascript engine. Hence Angular can accept anything in the URLs... Anyhow, semicolon is valid in URL...
@abhig38716 жыл бұрын
Thank you for the Series.
@ashwingowda26044 жыл бұрын
If I click on next when I'm inside /departments/5, it will open departments/6 detail page. How to avoid that?
@garapatigokulsairam58892 жыл бұрын
add if condition and navigate to 404 error view or to home view. let id = this.deptId + 1; if(id >5) this.router.navigate(['']); else this.router.navigate([/'departments',id]);
@fabiotchezaum6 жыл бұрын
So let me see if I understood: If you pass only the parameter it goes like mandatory; if you pass an object as parameter it goes as optional; Is it correct?
@idlevandal695 жыл бұрын
Hi Fabio, you probably have your answer by now but just in case someone else sees your question, the second parameter is of type NavigationExtras. If you go to the Angular docs and search for NavigationExtras you will see that there many different options you can pass as the second parameter to router.navigate().
@AnandAKGupta6 жыл бұрын
Hi, what is the preferred method to remove such Optional Route Parameters from the URL (individually)... for instance say if I use Relative Navigation from the next component (then these params still stay in the URL) I can manipulate the URL string and use router.navigateByUrl() instead of relative but that seems like dirty code. Any idea?
@priyanth123mohan6 жыл бұрын
hi vishwas I didn't get this point this.departmentId ? this.departmentId : null (1:50) can u pls expalin
@Codevolution6 жыл бұрын
Hi Priyanth, It is a ternary operator. If departmentId has a value, that is assigned to selectedId. If there is no value, null is assigned to selectedId. For more info - developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator
@JuanCamiloCampoT956 жыл бұрын
thank you, I had the same question. nice videos
@nasrihaithem95294 жыл бұрын
@@Codevolution if its not null then return departmentId ,else return null ?
@nasrihaithem95294 жыл бұрын
sorry i diidnt understand the semantic of it , if i assign departmentId to selectedId, the selectedId gonna be null if departmentId is ,else its gonna have the departmentId value !! i dont need a ternary operator here! it gonna be automatic no ?
@sahilumredkar4 жыл бұрын
When I click on back button id is showing in url it is right but it showing page not found what is solutions for that
@OtakuBuzz-N4 жыл бұрын
At first u see what u have written the route for the department listComponent and then on the gotoDepartments in native write if u have written same to same as shown in video u have to write department if not check once
@sonamohialdin33762 жыл бұрын
So good tutorial thank you
@DOHandDOH4 жыл бұрын
Shouldn't the query parameters be separated using a question mark? The semicolon is part of 1994 spec, which is now obsolete and the semicolon notation is technically illegal.
@warek-bs5hs3 жыл бұрын
These are optional parameters, not query. Though in such case using query is better and more clear
@Jovialguy1102 жыл бұрын
My doubt is why not use event emitting from child to parent class?
@OtakuBuzz-N4 жыл бұрын
Hi I it's returning to page not found What should I do
@msh19965 жыл бұрын
Great Videos
@Vikashkumar-vt9hl4 жыл бұрын
Binding method to a property is not good practice. Instead you can bind a boolean property and updated it under the routeMap subscription.
@Krazness4 жыл бұрын
Can you explain why this is the better practice?
@dhome1114 жыл бұрын
(click) it's doesn't work with me i'm using angular 9 can any one help me
@seenuvasanv6 жыл бұрын
Thanks.
@hatemalhasani5 жыл бұрын
Angular has two ways to pass parameters in url 1. router param almost part of route. e.g "/segment/1" // 1 is the id parameter. 2. queryParams optional parameter. e.g "/segment?id=1. in this video [2.55] there is none compiled error line 43 it should be this.router.navigate(['/departments'], { queryParams: { id: 1 } });