Angular 2 | Tutorial 21 | Child Routes | TutorialsPoint [w/ subs]



00:00:00 – so what is going on YouTube my name is
00:00:03 – Mei hole and welcome to your 30 second
00:00:05 – tutorials for angular and in this
00:00:07 – tutorial we're going to take a look at
00:00:09 – children in components and we're going
00:00:13 – to do that real quick
00:00:14 – so you see that I have removed that user
00:00:17 – slash ID one here that route from here
00:00:20 – because what we can do is right here we
00:00:23 – can very much just say controller or
00:00:26 – children rather what I was thinking
00:00:30 – so children here we go and then just
00:00:34 – like this array we have for the main
00:00:37 – routes the children would be the array
00:00:39 – of all the objects for the user world so
00:00:44 – we can say pass something like name and
00:00:47 – we can say this component as the user
00:00:50 – component and we can just get rid of
00:00:51 – this component from the parent length or
00:00:53 – you can just keep that as well but then
00:00:56 – this component would instantiate the
00:00:58 – children component so if it doesn't make
00:01:02 – sense to have a component for user
00:01:04 – because if it does not matches then you
00:01:08 – just want user to not show anything then
00:01:11 – you can just go ahead and make use of
00:01:13 – the component in the children only and
00:01:14 – then again you can create some other
00:01:17 – parts as well but like name and then
00:01:21 – Heidi something like that and you can
00:01:25 – save some other form of component to it
00:01:27 – like I don't know if we can just say use
00:01:30 – a component for now and we can pretty
00:01:32 – much just instead I use a component we
00:01:36 – can say I guess I do have this thing
00:01:38 – right but we can pretty much just
00:01:41 – console.log which we are doing right now
00:01:44 – okay so what we can do is take this and
00:01:49 – take a look in the browser
00:01:57 – so if we go to something like users may
00:02:01 – hole empathy you would see that we get
00:02:04 – the object as namely hole MBD and this
00:02:08 – children right here this child right
00:02:10 – here is fired right and if I grow a
00:02:12 – whole MV 2/5 we see that we get the ID
00:02:15 – as well and now in this case are this
00:02:18 – route is being fired right so that is
00:02:20 – not pretty much you create a very basic
00:02:23 – children's array inside your main route
00:02:27 – and that's how very much you would work
00:02:29 – with it so yeah that's all for this one
00:02:32 – and the next one we're going to discuss
00:02:33 – about what the paths match actually is
00:02:37 – and it's a bit interesting to look at if
00:02:41 – you're looking it for the first time so
00:02:43 – yeah that's all for this one and if you
00:02:45 – liked it then please don't forget to
00:02:46 – subscribe and thank you for watching
00:02:47 – I'll see you then in the next one


Video Url:
http://youtu.be/lZdQGpckr5w

Comments

comments