Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 27 2017 02:46
    davedub opened #19
  • Dec 27 2017 02:46
    davedub opened #19
  • Dec 27 2017 02:43
    davedub edited #6
  • Dec 27 2017 02:43
    davedub edited #6
  • Dec 27 2017 02:40
    davedub closed #6
  • Dec 27 2017 02:40
    davedub closed #6
  • Dec 27 2017 02:38
    davedub opened #6
  • Dec 27 2017 02:38
    davedub opened #6
  • Mar 25 2015 16:20

    brookr on master

    (markup) wrap code spans w/ bac… Merge pull request #16 from fra… (compare)

  • Mar 25 2015 16:20

    brookr on master

    (markup) wrap code spans w/ bac… Merge pull request #16 from fra… (compare)

  • Mar 25 2015 16:20
    brookr closed #16
  • Mar 25 2015 16:20
    brookr closed #16
  • Mar 25 2015 16:20
    brookr commented #16
  • Mar 25 2015 16:20
    brookr commented #16
  • Mar 25 2015 16:18
    brookr commented #17
  • Mar 25 2015 16:18
    brookr commented #17
  • Mar 25 2015 16:18

    brookr on master

    (markup) improve superagent mar… Merge pull request #17 from fra… (compare)

  • Mar 25 2015 16:18

    brookr on master

    (markup) improve superagent mar… Merge pull request #17 from fra… (compare)

  • Mar 25 2015 16:18
    brookr closed #17
  • Mar 25 2015 16:18
    brookr closed #17
Kevin Stephens
@kevinmstephens
Be back in the "office" on Friday if you'll be around
Tyler Morgan
@toastynerd
sounds good, I started working on it and ran into some issues with testing, so now I’m making a grunt mocha plugin that won’t stop execution when it runs into a failure
Hopefully I’ll have it done by end of day but we’ll see.
Tyler Morgan
@toastynerd
cfbot ping
CFBot is a Hubot
@cfbot-the-hubot
PONG
Tyler Morgan
@toastynerd
cfbot image me a platypus
Tyler Morgan
@toastynerd
cfbot image me an actual not animated platypus
Tyler Morgan
@toastynerd
blerg
Nicholas Harberg
@harberg
@Talamantez http://nodecopter.com/ There are events!
Ivan Storck
@ivanoats
cfbot ping
Robert Talamantez
@Talamantez
hey y'all - I'm doing the angular-phonecat tutorial. On step 6, I'm having trouble including the images folder...anyone been through this one yet? https://docs.angularjs.org/tutorial/step_06
thanks @harberg!
Kevin Stephens
@kevinmstephens
I did the entire thing, let me see if I have it saved on my comp still
it didn't help looking at the solution, I think all the solutions are on GitHub
that was a question...it didn't help looking at the solutions??
Kevin Stephens
@kevinmstephens
you put all the images in app/img/phones/??
Brian Studwell
@bwstud
cfbot image me platypus
Erik Nilsen
@enilsen16
:worried:
Brian Studwell
@bwstud
cfbot image me suffering
lame.
Erik Nilsen
@enilsen16
@bwstud you see my message
Brian Studwell
@bwstud
negative
Robert Talamantez
@Talamantez
@kevinmstephens got it figured out- over complicating things again
Andy Ernst
@AndyCErnst

Here's something I don't understand. Why does this

elements[i].onclick = makeHandler(i+1); 
var makeHandler = function(num) {  
              console.log("This is element #" + num);
}

behave differently than

elements[i].onclick = function(){console.log(i+1)}
This was in a code snibbit to demonstrate that you can't reference an iterator (the i) inside a for loop. The .onclick parts were inside for loops. But the part I don't get is why in the first one the function execute immediately, but in the second one it waits for the click event.
To fix this they made the function return a function
var makeHandler = function(num) {  
     return function() {
         console.log("This is element #" + num);
     };
};
Robert Talamantez
@Talamantez
maybe you have to do a prevent default to stop the first function from running right away
Andy Ernst
@AndyCErnst
http://jsfiddle.net/AfmA5/ if you want to mess around with it
In jQuery you would prevent default by taking in the event and calling preventDefault on it but this isn't jQuery. I don't think the event is passed anywhere and I'm not sure that's the problem
Tyler Morgan
@toastynerd
Whenever you add () to a function that’s already declared it calls it, if it’s an anonymous function it’s a declaration and you have to add the () to call it.
you could also do something like this:
elements[i].onclick = function() { makeHandler(i+1)};
and not have the return function in there
it’s a process called currying
Andy Ernst
@AndyCErnst
I've never really gotten my head around functions returning functions (unless they are constructors or something)
Tyler Morgan
@toastynerd
Yeah, it’s a little weird but it lets you pass a function by reference instead of calling the function.
well, I should say it lets you passs you a function with arguments by reference
Andy Ernst
@AndyCErnst
And Robert, I figured out how to grab the event http://jsfiddle.net/AfmA5/1/ I thought it was working differently than jQuery but you were right
Robert Talamantez
@Talamantez
cool
Andy Ernst
@AndyCErnst

How about this one

function addClickHandler(element) {
    element.click = function onClick(e) {
        alert("Clicked the " + element.nodeName)
    }
}

I understand how it's a circular reference with element referencing itself but I don't how how to eliminate it

Tyler Morgan
@toastynerd
it doesn’t have to be, you can get rid of that e, you’re not using it anywhere
Anna Luisa Patiño West
@aisapatino
@KuroFluff is the problem you're having that element is undefined or referencing the wrong thing within that function? i think you can also access the element through the jquery event object - something like e.target should work (so replace element.nodeName with e.target.nodeName)
Andy Ernst
@AndyCErnst
The e is not important in this one. The problem is that element.click has a ref to element.nodeName and according to the site I pulled this from that's element linking itself, which is a circular reference.
As they say, "Don't miss the forest for the Es"
Or was that trees?
Tyler Morgan
@toastynerd
@KuroFluff lol, do you have a repo up somewhere, it’s hard to know what’s going on without seeing the context.
Andy Ernst
@AndyCErnst
http://t.co/Rst6WUEvhq it's from an article 10 Most Common JavaScript Mistakes, #3 example 2
Unless this guy is totally off-base?