Advanced Directives with Angular JS (Part 1)

Поділитися
Вставка
  • Опубліковано 26 жов 2024

КОМЕНТАРІ • 86

  • @DavidMosher
    @DavidMosher  9 років тому +17

    Here's a new screencast I recorded on Advanced Directives with Angular JS. Enjoy! :) #angularjs #screencast

    • @ParsiMusik
      @ParsiMusik 8 років тому +2

      +David Mosher very useful thanks :)

    • @DavidMosher
      @DavidMosher  7 років тому +1

      I've started up again Jesse, I just published Part 2; look for more to come in the near future as well :) ua-cam.com/video/4zG8SfucUzg/v-deo.html

    • @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 :)

  • @bebopwestern
    @bebopwestern 9 років тому +3

    One of the best Angular videos out there. Great job!

  • @Lachezariii
    @Lachezariii 8 років тому +1

    Dude, this is the best angular directives tutorial I''ve ever seen BY FAR!! Thanks for that! Take care

  • @DomViking
    @DomViking 8 років тому +1

    One of the better tutorials on youtube, thanks for making this video!

  • @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!

  • @TechWarriorz
    @TechWarriorz 9 років тому +2

    You sir are a beast, this is THE BEST video based on Directives that I have seen.

  • @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.

  • @jaykan111
    @jaykan111 9 років тому +6

    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?

  • @CienciaFiccionPeru
    @CienciaFiccionPeru 9 років тому

    Incredible tutorial of advance directives! Thanks so much for your collaboration :)

  • @srik9061
    @srik9061 6 років тому

    This was a very illuminating talk. Thank you very much

    • @DavidMosher
      @DavidMosher  6 років тому

      Glad it was helpful Srikanth! :)

  • @GiteshPurbia
    @GiteshPurbia 9 років тому +1

    Nice tutorial. Now i have clear many doubts about directives.Thanks

  • @billlock9766
    @billlock9766 8 років тому +1

    Thank you for taking the time to do it right; great information!

  • @symmetri
    @symmetri 9 років тому

    Great screencast! Thanks for taking the time, this is a tricky subject.

  • @arsal123
    @arsal123 9 років тому +1

    A great custom directive learning. Love it.

  • @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 :)

  • @ChyngyzArystanuulu
    @ChyngyzArystanuulu 9 років тому

    Thanks for the great tutorial David, it is very useful. Waiting for the second part.

  • @gauravkakkar87
    @gauravkakkar87 8 років тому

    Thanks for creating this tutorial. Very helpful and informative!

  • @lok_esh
    @lok_esh 9 років тому

    Awesome. I really like the way you have explained the concepts.. great tutorial :)

  • @abrieljohngabriel8686
    @abrieljohngabriel8686 6 років тому

    Thanks David!. Very comprehensive but very clear as well. :)

    • @DavidMosher
      @DavidMosher  6 років тому

      Glad it was helpful Abriel :)

  • @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.

  • @JorgeCorradi
    @JorgeCorradi 8 років тому

    Man, I can not thank you enough... You rock!!

  • @KalpeshPanchal
    @KalpeshPanchal 7 років тому

    Thanks David, Amazing screencast. We can achieve the desired functionality without jQuery as angular comes with jQueryLite.

  • @aleixsuau867
    @aleixsuau867 8 років тому +1

    Great video David, thank you very much!

  • @AkshayKadu
    @AkshayKadu 8 років тому

    Nicely explained. Thanks for sharing.

  • @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.

  • @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...

  • @AshkonHemmati
    @AshkonHemmati 8 років тому

    You sir, are an absolute beast!

  • @ShrinivasanNeelamegam
    @ShrinivasanNeelamegam 8 років тому +1

    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 років тому +1

      Hi Shrinivasan, I just published Part 2 today; a little late but better late than never right? ;) ua-cam.com/video/4zG8SfucUzg/v-deo.html

  • @HolyShoyo
    @HolyShoyo 9 років тому

    Thanks for tutorial.
    Great example.

  • @niculistana7227
    @niculistana7227 8 років тому

    Very well done! Thank you.

  • @VishalKumarTech
    @VishalKumarTech 9 років тому +1

    Very helpful. Thank you so much!

  • @antonzizic3483
    @antonzizic3483 9 років тому

    very usefull vid to help understanding directives. thank you !!!

  • @jamesbarrow
    @jamesbarrow 8 років тому

    Thank you so much for this, it was a great tutorial, I learned a lot! High five!

  • @gaurav63105
    @gaurav63105 9 років тому

    i superliked this,thanks man ,you were super helpful

  • @samehghanmi4487
    @samehghanmi4487 8 років тому

    Thank you David. Subscribed.

  • @pimisi
    @pimisi 9 років тому

    Great tutorial. Really insightful.
    Quick question... How did you deal with the bug of the repetition of the editor rows?

  • @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 :) ua-cam.com/video/4zG8SfucUzg/v-deo.html

  • @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.

  • @alexfrolov7546
    @alexfrolov7546 8 років тому +1

    Great tutorial. David, why did you stop publishing videos ?

    • @DavidMosher
      @DavidMosher  7 років тому +1

      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! ua-cam.com/video/4zG8SfucUzg/v-deo.html

    • @alexfrolov7546
      @alexfrolov7546 7 років тому

      \0/

  • @ehguacho2008
    @ehguacho2008 8 років тому +1

    amazing bro, i've learned a lot thru this vid. thanks a lot (:

  • @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.

  • @sijimathew9982
    @sijimathew9982 8 років тому +2

    thank you sir.

  • @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.

  • @codrinf
    @codrinf 8 років тому

    great tutorial!

  • @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 :) ua-cam.com/video/4zG8SfucUzg/v-deo.html

  • @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);
    };
    }
    }
    }])

  • @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 років тому +1

      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. :)

  • @vyacheslavzgordan6725
    @vyacheslavzgordan6725 8 років тому

    Thank you!

  • @iVish
    @iVish 9 років тому

    Nice post

  • @pramodrathod007
    @pramodrathod007 9 років тому

    gr8 tutorial !!

  • @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.

  • @nadavmor4841
    @nadavmor4841 4 роки тому +1

    web developer from the future: wow, i don't miss those days...

    • @DavidMosher
      @DavidMosher  4 роки тому +1

      nadav mor 🤣 ain’t that the truth!

  • @sridharkorrapati6232
    @sridharkorrapati6232 9 років тому

    Need help in creating angular directive using JQXTreeGrid widget. With column and pagination

  • @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.

  • @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.

  • @valikonen
    @valikonen 7 років тому

    Very nice example, but now I understand why React is so popular, is much easier, much clean...

  • @MrNSundar
    @MrNSundar 9 років тому

    hi nice tutorial..$(editor).insertAfter(element.parents("tr")) this line is giving me Cannot read property 'ownerDocument' of undefined..

  • @suhas.deshpande
    @suhas.deshpande 9 років тому

    You rock.

  • @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 7 років тому

    part II pleaseeeeeeeeeee

    • @DavidMosher
      @DavidMosher  7 років тому +1

      Hi Mendy, I just finished publishing Part 2! Check it out and let me know what you think :) ua-cam.com/video/4zG8SfucUzg/v-deo.html