Advanced Directives with Angular JS (Part 1)

  Рет қаралды 78,573

David Mosher

David Mosher

Күн бұрын

Пікірлер: 86
@DavidMosher
@DavidMosher 9 жыл бұрын
Here's a new screencast I recorded on Advanced Directives with Angular JS. Enjoy! :) #angularjs #screencast
@ParsiMusik
@ParsiMusik 9 жыл бұрын
+David Mosher very useful thanks :)
@DavidMosher
@DavidMosher 7 жыл бұрын
I've started up again Jesse, I just published Part 2; look for more to come in the near future as well :) kzbin.info/www/bejne/aquqaYacqsiIsMk
@keanubaker7421
@keanubaker7421 3 жыл бұрын
I realize it's quite randomly asking but does anybody know a good site to stream new movies online ?
@lucafelipe2347
@lucafelipe2347 3 жыл бұрын
@Keanu Baker I use Flixzone. You can find it on google :)
@fabiantucker7992
@fabiantucker7992 3 жыл бұрын
@Keanu Baker I use FlixZone. You can find it on google :)
@Lachezariii
@Lachezariii 8 жыл бұрын
Dude, this is the best angular directives tutorial I''ve ever seen BY FAR!! Thanks for that! Take care
@bebopwestern
@bebopwestern 9 жыл бұрын
One of the best Angular videos out there. Great job!
@jaykan111
@jaykan111 9 жыл бұрын
Hey David, great tutorials on leveraging AngularJS directives controller for delegating API for child directives. Quick correction on controller($scope) vs. link (scope), the "$" $scope in controller actually indicates that the scope value is being injected into the current context, but not all references to scope are based on the dependency injection (For instance, in $watch, link, and cloning functions) scope is always being passed as a positional argument, regardless of its name. From a functional perspective, it works the same way. Anyways great tutorials :)
@DavidMosher
@DavidMosher 9 жыл бұрын
Great point Jay Kan, thanks for clearing that up. I don't recall my exact wording but I think they are still the same scope instance in the end; the difference, as you've pointed out, is in how they get there (DI vs Positional Hardcoded Argument). :)
@jaykan111
@jaykan111 9 жыл бұрын
***** Do you happen to cover how to toggle inner editor directive in your other tutorials or part II?
@TechWarriorz
@TechWarriorz 9 жыл бұрын
You sir are a beast, this is THE BEST video based on Directives that I have seen.
@KevinCarbonaro
@KevinCarbonaro 9 жыл бұрын
Although I am still way far from understanding all of what you mentioned, your tutorial gave me a lot of practical pointers of what I should learn next to level up my custom directives. Thanks!
@gabrielbarroso4118
@gabrielbarroso4118 8 жыл бұрын
Thank you so much! I'm an experienced Javascript developer, just wanted to know what we can do with Angular on a advanced level and this was great.
@DomViking
@DomViking 9 жыл бұрын
One of the better tutorials on youtube, thanks for making this video!
@CienciaFiccionPeru
@CienciaFiccionPeru 9 жыл бұрын
Incredible tutorial of advance directives! Thanks so much for your collaboration :)
@arsal123
@arsal123 9 жыл бұрын
A great custom directive learning. Love it.
@billlock9766
@billlock9766 8 жыл бұрын
Thank you for taking the time to do it right; great information!
@myyellowdog
@myyellowdog 8 жыл бұрын
Wow! Great video. I just learned more about directives than I learned from reading "AngularJS Up and Running," which is actually a pretty great book, so no small feat! I also loved how you showed us the techniques for building up one step at a time and hunting bugs when the code wasn't perfect-an inevitable aspect of the job. The $0 trick alone will undoubtedly save me tons of time in the future. Quick question: why did you have to use compile for the editor initializer bit? (This might be obvious to me as I work through the code myself in the morning, so please forgive this possibly premature question.) Thank you so much for sharing your knowledge. You da man! I am searching now for your other videos.
@GiteshPurbia
@GiteshPurbia 9 жыл бұрын
Nice tutorial. Now i have clear many doubts about directives.Thanks
@ChyngyzArystanuulu
@ChyngyzArystanuulu 9 жыл бұрын
Thanks for the great tutorial David, it is very useful. Waiting for the second part.
@symmetri
@symmetri 9 жыл бұрын
Great screencast! Thanks for taking the time, this is a tricky subject.
@srik9061
@srik9061 6 жыл бұрын
This was a very illuminating talk. Thank you very much
@DavidMosher
@DavidMosher 6 жыл бұрын
Glad it was helpful Srikanth! :)
@adamkruppa6083
@adamkruppa6083 9 жыл бұрын
Thank you very much David! Awesome video, please carry on, love your works and the way you give advice how to solve the problem, how to think about it and not just code.
@DavidMosher
@DavidMosher 9 жыл бұрын
You're welcome Ádám Kruppa, I'm glad you enjoyed the screencast :)
@gauravkakkar87
@gauravkakkar87 8 жыл бұрын
Thanks for creating this tutorial. Very helpful and informative!
@pimisi
@pimisi 9 жыл бұрын
Great tutorial. Really insightful. Quick question... How did you deal with the bug of the repetition of the editor rows?
@lok_esh
@lok_esh 9 жыл бұрын
Awesome. I really like the way you have explained the concepts.. great tutorial :)
@ShrinivasanNeelamegam
@ShrinivasanNeelamegam 8 жыл бұрын
Great video David. I couldnt find any video in youtube that explains advanced directives this well. Could you post the link to the advanced directives part 2 which you mention in this video?
@DavidMosher
@DavidMosher 7 жыл бұрын
Hi Shrinivasan, I just published Part 2 today; a little late but better late than never right? ;) kzbin.info/www/bejne/aquqaYacqsiIsMk
@Awesomo4000
@Awesomo4000 9 жыл бұрын
@37:25 A comment can be used for a directive (exampleDirective), if the restrict is set to M. So it seems logical that a comment is seen as an element. Not sure why it exists however.
@abrieljohngabriel8686
@abrieljohngabriel8686 7 жыл бұрын
Thanks David!. Very comprehensive but very clear as well. :)
@DavidMosher
@DavidMosher 7 жыл бұрын
Glad it was helpful Abriel :)
@AkshayKadu
@AkshayKadu 8 жыл бұрын
Nicely explained. Thanks for sharing.
@ArkinSturmdranger
@ArkinSturmdranger 8 жыл бұрын
Very awesome guide, thanks. Hoping to write my own DSL using some of these concepts/ techniques.
@ArkinSturmdranger
@ArkinSturmdranger 8 жыл бұрын
It's kinda another way of saying "how do we craft an Absract Syntax Tree (AST)?", albeit we're still stuck in in v1 Angular, whereas the rest of the world's leaving us behind in v2 I suppose. heh, oh well, can't win em all.
@brennenawana9826
@brennenawana9826 8 жыл бұрын
Awesome screencast! Thank you. Has the second video been published yet? I can't seem to find it.
@DavidMosher
@DavidMosher 7 жыл бұрын
Hi Brennen, I may be late to the party but I just published Part 2; check it out and let me know what you think :) kzbin.info/www/bejne/aquqaYacqsiIsMk
@JorgeCorradi
@JorgeCorradi 8 жыл бұрын
Man, I can not thank you enough... You rock!!
@aleixsuau867
@aleixsuau867 9 жыл бұрын
Great video David, thank you very much!
@KalpeshPanchal
@KalpeshPanchal 7 жыл бұрын
Thanks David, Amazing screencast. We can achieve the desired functionality without jQuery as angular comes with jQueryLite.
@AshkonHemmati
@AshkonHemmati 8 жыл бұрын
You sir, are an absolute beast!
@chenrvn
@chenrvn 9 жыл бұрын
First of all thanks for sharing. It great screen cast, love your learning way. Second, regard to pre and post link it work fine/as excpected because the column grid is the leaf so it dosnt care for the order. If u will put pre on directive parent such grid-columns so than he will run the linkin function first. U can use also the order number of the directive but u need to put extra care regard this method :-) (u know that). Once again thanks a lot for this video men.
@DavidMosher
@DavidMosher 9 жыл бұрын
Ah yes, thanks for that Chen Reuven, I forgot you have to use the pre/post on the parent element to determine child linking order :D
@chenrvn
@chenrvn 9 жыл бұрын
***** one more thing. i put console.log to see the function execution ordewr and i see something strange. this is the output: gridScreen controller... gridColumns controller... gridColumn link... gridColumns link... gridScreen link... grid controller... withInlineEditor link... editorInitializer controller... editorInitializer link... editorInitializer controller... editorInitializer link... editorInitializer controller... editorInitializer link... How can be that gridScreen link is call before is child? moreover how can be that grid controller is called after the link function of the grid? Thanks:) - i have image but i cannot upload it here there is no such function here...
@HolyShoyo
@HolyShoyo 9 жыл бұрын
Thanks for tutorial. Great example.
@niculistana7227
@niculistana7227 8 жыл бұрын
Very well done! Thank you.
@zoranvulanovic3780
@zoranvulanovic3780 8 жыл бұрын
Great tutorial. Clear and understandable for everyone who know basic of angular. I think your pre and post did not work because is living in link function. Pre and post must live compile function i guess.
@antonzizic3483
@antonzizic3483 9 жыл бұрын
very usefull vid to help understanding directives. thank you !!!
@ehguacho2008
@ehguacho2008 9 жыл бұрын
amazing bro, i've learned a lot thru this vid. thanks a lot (:
@VishalKumarTech
@VishalKumarTech 9 жыл бұрын
Very helpful. Thank you so much!
@gaurav63105
@gaurav63105 9 жыл бұрын
i superliked this,thanks man ,you were super helpful
@alexfrolov7546
@alexfrolov7546 8 жыл бұрын
Great tutorial. David, why did you stop publishing videos ?
@DavidMosher
@DavidMosher 7 жыл бұрын
Hi Alex, I took a bit of a break but I intend to start publishing again. I started today by pushing Part 2 of this series! kzbin.info/www/bejne/aquqaYacqsiIsMk
@alexfrolov7546
@alexfrolov7546 7 жыл бұрын
\0/
@samehghanmi4487
@samehghanmi4487 8 жыл бұрын
Thank you David. Subscribed.
@ParthDaveIn
@ParthDaveIn 8 жыл бұрын
Very nice explanation. But I could not find Part 2. Can you please post a link?
@DavidMosher
@DavidMosher 7 жыл бұрын
Hi Parth, Part 2 just got published today :) kzbin.info/www/bejne/aquqaYacqsiIsMk
@adamkruppa6083
@adamkruppa6083 9 жыл бұрын
While doing the extra credit, what u mentioned at the end of the vid, I ran to a problem, probably it's easy, but if i trigger the arrows, and I want the other arrows to auto close if it was open, then, how can I do that? Tried with ng-blur too but couldn't broadcast 2 events(ng-click didn't work then) and don't know if it is possible or it is a bad pattern to reach attributes of sibling directives. So can you give me a hint, how to to that? If this is on topic and you have time for this.
@DavidMosher
@DavidMosher 9 жыл бұрын
Hey Ádám Kruppa I Would love to see a github pull request or gist with some of your code, easier to visualize that way and perhaps we could come up with a solution together? :)
@adamkruppa6083
@adamkruppa6083 9 жыл бұрын
***** Solved the problem, just needed to rethink it, started to learn Angular about a month ago, so still have questions in my head made a pull request. And I am really interested in your opinion, because I assume you would have done it differently and better. :)
@jamesbarrow
@jamesbarrow 8 жыл бұрын
Thank you so much for this, it was a great tutorial, I learned a lot! High five!
@KevinCarbonaro
@KevinCarbonaro 9 жыл бұрын
I am now trying to create a sortable attribute however I cannot find a way to bind a click function to the column header yet. This is my directive so far (does not work) .directive('sortable', ['$compile', function($compile) { return { restrict: 'A', compile: function(el) { el.removeAttr('sortable'); el.attr('ng-click', function() { console.log('clicked'); }); var fn = $compile(el); return function(scope){ fn(scope); }; } } }])
@MrNSundar
@MrNSundar 9 жыл бұрын
hi nice tutorial..$(editor).insertAfter(element.parents("tr")) this line is giving me Cannot read property 'ownerDocument' of undefined..
@sriharsha1150
@sriharsha1150 8 жыл бұрын
How did the grid-screen and gridScreen get mapped?
@Suamere
@Suamere 8 жыл бұрын
That is just a convention in AngularJS. Wherever there is a Capital Letter between words, a dash is added instead. soThisVariableHere becomes so-this-variable-here. Don't need to worry about how, that's the point of Conventions.
@sijimathew9982
@sijimathew9982 9 жыл бұрын
thank you sir.
@codrinf
@codrinf 8 жыл бұрын
great tutorial!
@sridharkorrapati6232
@sridharkorrapati6232 9 жыл бұрын
Need help in creating angular directive using JQXTreeGrid widget. With column and pagination
@ranostaj-dev
@ranostaj-dev 9 жыл бұрын
how you decide which functionality goes into Controller and which into Link function?
@petestorey2557
@petestorey2557 9 жыл бұрын
jan ranostaj The link function is called when the directive is first used in the view and can initialise/edit the dom elements and attributes, set up/access scoped variables and can access controllers. The controller is used to hold all of your other variables and functions that are accessible via expressions in your views like in simpler angular applications or templates specified in templateUrl.
@ratnesh1104
@ratnesh1104 9 жыл бұрын
1 correction regarding the order of pre-link and post-link phase. Overall logic is as: 1. Compile method is invoked in the way the tree is traversed. 2. During linking phase, the traversing happens in the same way the tree traversing do with following algorithm: i) If element has pre-link, invoke it. ii) If it has child element, and post-link method. Go down the tree without invoking post-link. iii) If the element doesn't have any child node/element, and has post-link method then invoke post-link. So any element without child and having both pre and post linking method get executed at the same time as: pre-link->post-link, as it is "gridColumn" in your case. iv) Once child linking method gets invoked, go up the tree, and invoke post method of the parent.
@KevinCarbonaro
@KevinCarbonaro 9 жыл бұрын
My json rows have sub objects such as 'Employee.DisplayName', so naturally I am adding that as a column field. However it does not seem to be able to render anything with {{row[column.field]}}. When I remove the '.DisplayName' I do get the following data returned as an Employee row: {"Department":"Management","DisplayName":"Jackie"} Maybe someone out there can point me to why it is happening.
@KevinCarbonaro
@KevinCarbonaro 9 жыл бұрын
I managed to work around it by extracting only the data needed by the columns field dynamically into the rows array.
@vyacheslavzgordan6725
@vyacheslavzgordan6725 8 жыл бұрын
Thank you!
@pramodrathod007
@pramodrathod007 9 жыл бұрын
gr8 tutorial !!
@iVish
@iVish 9 жыл бұрын
Nice post
@suhas.deshpande
@suhas.deshpande 9 жыл бұрын
You rock.
@nadavmor4841
@nadavmor4841 4 жыл бұрын
web developer from the future: wow, i don't miss those days...
@DavidMosher
@DavidMosher 4 жыл бұрын
nadav mor 🤣 ain’t that the truth!
@valikonen
@valikonen 7 жыл бұрын
Very nice example, but now I understand why React is so popular, is much easier, much clean...
@richardlucas8666
@richardlucas8666 8 жыл бұрын
It would have been helpful for you to show the desired end result before you jumped into writing the code
@mendykatz9199
@mendykatz9199 8 жыл бұрын
part II pleaseeeeeeeeeee
@DavidMosher
@DavidMosher 7 жыл бұрын
Hi Mendy, I just finished publishing Part 2! Check it out and let me know what you think :) kzbin.info/www/bejne/aquqaYacqsiIsMk
Advanced Directives with Angular JS (Part 2)
39:47
David Mosher
Рет қаралды 1,7 М.
John Papa - 10 AngularJS Patterns - Code on the Beach 2014
1:01:27
Code on the Beach
Рет қаралды 83 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 8 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 118 МЛН
Testing Strategies for Angular JS
1:01:46
David Mosher
Рет қаралды 49 М.
Dave Smith  - Deep Dive into Custom Directives - NG-Conf 2014
33:50
Deep Dive into Custom Directives in AngularJS
1:05:39
Infragistics
Рет қаралды 27 М.
Introduction to Angular JS
50:05
David Mosher
Рет қаралды 200 М.
Angular Crash Course | Learn modern Angular in 90 minutes
1:29:09
Code with Ahsan
Рет қаралды 39 М.
Building DSLs with JavaScript/CoffeeScript
1:05:33
David Mosher
Рет қаралды 1,8 М.
Angular + React = Speed Dave Smith
19:27
ng-conf
Рет қаралды 123 М.
End to End with Angular JS
52:59
David Mosher
Рет қаралды 130 М.
Introduction to Angular.js in 50 Examples (part 1)
1:04:49
Curran Kelleher
Рет қаралды 961 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 8 МЛН