« first day (3390 days earlier)      last day (1541 days later) » 
04:00 - 19:0019:00 - 00:00

V.7
4:26 AM
Hey all
Why would ng-init="somefunction()" with somefunction contained in Controller.js do not work, while ng-init="test='test'" work?
I mean, this function exists in scope
 
 
2 hours later…
Ben
6:09 AM
Hi guys, i am trying to detect shortcut click on Alt+Q+1(or any number) in my angular app. I started like this, but i can't add more than one char, how can i do it (i can't find any question about it in stack-overflow, i might didn't search well.

document.addEventListener ('keydown', function (zEvent) {
if (zEvent.altKey && zEvent.key === 'q') {
 
@Ben Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
6:27 AM
Hi All
what is the difference between having launch.json and tsconfig.json in my node solution running in vs code.
 
 
2 hours later…
8:22 AM
6 messages moved to Trash can
Please don't just dump a link to a question in here.
 
user12688320
Hii
 
user12688320
anyone please help me
 
|| welcome sssss
 
@sssss Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
> If you have a question, just post it, and if anyone's free and interested they'll help.
 
user12688320
8:34 AM
I already posted
 
user12688320
@karelG
 
ah it got binned. Well reading the Q atm
 
user12688320
 
the error message is clear. scrollMonitor is not known
 
user12688320
But Where I should include and how can you please help
 
8:47 AM
@sssss you have to figure out why the scrollmonitor construct is failing (first error message). This has led to scrollMonitor being undefined. Using it leads to the second error.
So debug the load phases. See if jQuery is not causing it. There are some closed issues about that problem when using it with jQuery on the github page of scrollmonitor.
 
user12688320
Yes But I had included and even checked everything is fine
 
if everything is fine, you won't get errors. Again, debug it
 
user12688320
even I had downloaded and included the scrollMonitor js file even getting the sam error
 
user12688320
I am a python developer and having less knowledge about javascript and jquery please help me out
 
Hi, how do you display the return value from a function in reactjs?
 
user12688320
8:53 AM
I didnt understood @Falady
 
hmm i will give further details
i just found an answer and testing it
 
user12688320
Ok thankyou @Falady
 
this was my issue: stackoverflow.com/questions/59927622/… and I have just got the answers that I was looking for
Thanks for replying anyway cheers!
 
user12688320
this was my issue stackoverflow.com/questions/59925329/… can anyone help me
 
i will have a look at it after im done with mine
 
user12688320
9:04 AM
Ok @Falady
 
V.7
11:08 AM
Why would ng-init="somefunction()" with somefunction contained in Controller.js do not work, while ng-init="test='test'" work?
I mean, this function exists in scope
 
it should work if that function is in scope
no errors? Did you have added a log at start of somefunction() body?
 
hi.. does anyone know how to retrieve the number of document from firestore and print it on UI?
it works on the console but i want it to be displayed on my UI
 
@Falady Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
belowEighteen (){
		//var to_return;
		const db = firebase.firestore();
		db.collection('answers')
		.where('age', '==', 'Less than 18')
		.get()
		.then((res) =>{
			console.log(res.size);
			this.setState({
				total: res.size
			})
		})
		.catch((error) => {
			console.log(`Error getting documents: ${error}`);
		});
	}
 
11:29 AM
that this at this.setStatus is not the object you may think of
 
11:51 AM
Mornin..
Im sleepy...
 
12:18 PM
Anyone know of a way to update/change a CSS animation WITHOUT deleting and re-creating the element, the element has like 30 children, no way Im "remaking" that in js...
Like, my animation uses CSS variables to control it, I can change the Textures with css variables, no problem, but when I want to change the "degrees" of the animation with JS (by editing the --angle variable) it doesnt update, probably because the variable is being used in the actual keyframe statement
 
ehh yea i guess so @KarelG
 
@TaylorS work with classes. You can then (en/dis)able it
 
Tried that
Didnt work :P
View the current JS, in function updateAnimation();
I want dat.gui to be able to control the angle at which you can see the skin in the 3D controls folder variable
but that requires restarting the animation (so that the keyframe statement sees the new value in the --angle variable)
i mean, I guess something like this could work: jsfiddle.net/leaverou/xK6sa
 
css animations aren't really great at being interrupted
 
Yeah, noticed that a while back with a similar project to this
 
12:24 PM
they'll do the full animation before you can make it do anything else
that said, you should use css unless the only way to do it is via javascript
 
no, if you cancel it with animation = "none"
See the JSFiddle above
you can see clicking it in the middle of the animation cancels and restarts it
 
that must be new then
 
Not really, I used to use it for progress bars a year ago
If you mean new to ECMA 6
then maybe
I started coding AFTER ecma 6
 
well when you've been coding since 2003, ecma is new :)
 
dude Im only 14 :3
I wasnt even born then
But I understand what you mean
Also I just noticed THIS in my update function:
 setTimeout(100);
uhhh yeah wrong syntax lol
 
12:28 PM
the day will come when you'll say something is new, and someone a lot younger than you will say, "it was new like a year ago.."
 
ya dumdum
 
and then reality will hit you hard :)
 
well, I come into that problem in the reverse a lot
 
well I suppose you would, you're still young
 
"Oh yeah I remember when I was young and movies were 2d" my parents are like.. "OH! When YOU were young huh?"
(not all movies were 2d, just my child self watched too many hand drawn cartoons for my own good)
 
12:31 PM
I remember getting teased for that too
they always found it hilarious that I would talk about when I was younger when I was young
 
Yup the animation code is working now lol, Its a little "flashy" might give people Epilepsy, but after that 10 miliseconds of "no animation" it goes to the angle you choose
Ikr, I always love telling about things from when I was 3-7, but im only 14, so my parents are like giving me strange looks
Solved the flashy thing, timeout at 1 ms, then 10 ms
1 ms isnt very "see-able" so it shouldnt be too bad anymore
 
@Neil the css property expects a keyframe name or "none". If the latter is provided, no animation is performed. Been there from the start tho.
 
oh interesting
 
although I am not so good with that stuff. That's more rlemon expertise.
 
I just used/abused that with variables to make a Progress Bar maker a while back, didnt realise Id be using it with my Minecraft skin renderer lol
making 3D models in pure css is tiring
 
12:35 PM
@KarelG I would have assumed that it would "reset" the animation in that case
 
not to mention CSS Sprites was a pain in the ass when I first start (also not to mention trying to figure out how to resize in Nearest Neighbor so my pixelated skins DIDNT LOOK LIKE CRAP)
 
does "none" mean to cancel the current animation or does it mean to reset it like there was never any animation to begin with?
 
Think of it like Display: none;
turns it off
 
in other words, if it animates turning 90 degrees and then you set animation to "none", does it turn left 90 degrees immediately?
 
no it just goes back to the default state
:P
Animation isnt "actually moving" its just a visual
 
12:37 PM
you mean "yes, it goes back to the default state"
 
so canceling it, or turning it off reveals the REAL thing
 
or "no, it remains as is"
 
"yes, it goes back to the default state"
 
ah ok
so it's a reset button
 
Yuppers
 
12:37 PM
that makes sense
 
Its useful for animations you want repeated, but also changed, like Progress Bars, HTML Entity models, etc
 
In fact I didn't think it was possible to cancel an animation
 
and in my case, 3D minecraft skins XD
 
animation with keyframes are states. by using 'none', you are just removing the states. Everything fallbacks to the initial state (not the initial state of the animation frame).
 
(by cancel, I mean simply halt it half-way through)
 
12:38 PM
^
karels smarter, knows the terminology, I just know what does what..
Neil, thatd be more like a Pause
Never thought of it being possible though. Unless you did some fancy JS tracking stuff with variables
and set it Statically to those values
(Dont quote me on anything I say :D)
 
@Neil for a fine-grained control, you need js 👉 playState
 
Holy mother of gosh.. Ive gotten more views on my 2 3D minecraft JS projects then any other project Ive ever made COMBINED
Except Tearable Wool 2
which has like 120 views
switching to world history, cya guys
And considering new classes arent used to me coding during period, Cant code during class, bye
 
3d stuff is impressive
if you can do it with css, all the more
 
hi
i'm trying to subtract list of elements from another one before hiding/displaying them
  function hide (A,B) {
    A = A.length ? A : [A];
    for (var index = 0; index < A.length; index++) {
      A[index].style.display = 'none';
    }
  }
where A is the list of elements and B is the list of elements i don't want to hide
what is the most efficient way to do it ?
 
indexOf/includes
 
12:51 PM
@diamond is it entirely dynamic?
if not, use classes for this
you can query all elements with class A and not class B for instnace
 
ye do that
 
@Neil you are right if its not dynamic classes would be the best answer but its unfortunately it has to be dynamic
 
hmm, do they have ids?
 
i think indexOf/includes would be one of the answers here. but I also thought of doing two functions under the same function like so .

\
 
the reason I ask, is that you could simply remove all ids in A which exist in B, then proceed to remove all remaining elements
if you had a lot of said elements, this would be better
but for few elements, indexOf would still work
 
12:56 PM
function hide (A,B) {
    A = A.length ? A : [A];
    for (var index = 0; index < A.length; index++) {
      A[index].style.display = 'none';
    }
B = B.length ? B : [B];
    for (var index = 0; index < B.length; index++) {
      B[index].style.display = 'block';
    }
  }
its like a list of 10 elements in A and 10 in B
 
this would probably work best
you're just looping through A and B ultimately.. O(n)
checking if one is contained in the other in a loop is O(n^2)
 
ohh , great !!
that is what i thought of at first but its pretty basic that is why i asked to see if there is more effective way to do it that i'm not aware of , Thanks a lot !
 
ideally you would only pass the elements you want to hide though
but if you have no way of knowing this without explicitly removing all of B from A, then this is fine
 
@diamond fyi arrays have .forEach
not sure why you are still using a for loop. Unless A and B are nodelists ?
 
@KarelG I totally forgot about them , aren't they the same thing ?
 
1:06 PM
yes. But be aware that .forEach on a nodelist is not supported on IE
 
oh ok , it looks much more simpler but since its partially supported I'd better stick with the for loop then , Thanks a lot for reminding me though.
 
guyssssss im trying to return res.size to my UI using this function.. but nothing seems to work....
 
@Falady Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
1 message moved to Trash can
 
belowEighteen (){
		const db = firebase.firestore();
		db.collection('answers')
		.where('age', '==', 'Less than 18')
		.get()
		.then((res) =>{
			console.log(res.size);
			return res.size;
		})
		.catch((error) => {
			console.log(`Error getting documents: ${error}`);
		});

	}
it returns res.size to my console, but not my UI...
im trying and trying to get my <li>Less than 18 (Total: {this.belowEighteen()} )</li> to return res.size but nothing is showing
is it even possible to display res.size on UI?
 
Yeah, but you're trying to output a string and you're returning nothing inside your function.
 
1:22 PM
so res.size is a string?
 
That's not what I'm saying
 
if i put return res.size after the catch, that is inside the belowEighteen(){} it won't recognize res
not sure if u get what i mean
 
Your belowEighteen() function is returning undefined, you aren't returning anything from it.
 
yes i know which is why there is nothing to show on my UI
how to do this though..
been stuck on this for 2 days...
 
You'll need to use state since it's async
 
1:28 PM
stackoverflow.com/questions/59927622/… i did try to use state based on this answer given to me. but it only display 0 all alone
along
 
hi , is there is a way to query item inside a div and add it to a list ?
<div class='list'>
       <input id='A1'></input>
       <input id='A2'></input>
</div>
lets say we have a div with multiple input , is there is away to call out all inputs and labels in the div without grouping each one of them under the same class ?

document.querySelectorAll(".list");
 
'.list input' to get all inputs within an element with class "list"
 
1:45 PM
@KarelG that is great and if i have radio , or labels or any other thing , do i need to add them or make a separate command for it ?
 
you can use , to add more selectors
'.list input, .list radio'
 
Awesome !!
 
but assume that there are all inputs with labels and you want only the input, you can simplify it
 
if there are only input it won't came back with an error ,right ?
 
.list :not(label) = grab everything in element with class "list" except that it is a <label> element
those are CSS selectors. You can do some research on it and learn how it work so that you can use it
 
1:48 PM
alright , thanks alot man , u saved me a bunch of time.
 
Howdy to all
If you were looking up the dates for a sporting event, would you rather read: A.) September 20th, 2020 - September 21st, 2020 or B.) September 20th - 21st, 2020
Seems obvious enough... I like B better just tossing it out there to bring a little life to the room
Ive had A for a long time. Now converting to B
 
Possible issues with B if the event ends in a different month?
 
Yea... I agree but have patched it with
January 30th - February 1st, 2020
which still looks good
I think A is thinking programmer way
 
We use A as I didn't like mixing A & B
 
Yea Id been using A for a long time
Plz see
 
1:58 PM
that's not consistent
 
Thats how B looks in real life
Convereted just now
I think B might even be more grammatically correct
but not sure
 
Karel had the right word, I don't like the inconsistency, throws me off a bit
 
U say inconsistent?
No other way on multi month span
and a lot of repeated "September"s etc
with A
B it is folks
 
I can only tell from my personal experience that people likes to nitpick about something being inconsistent.
even for such silly text display
 
Yea u have a very good point
I feel it IS consitent to the eye tho
Welp, We'll See
how visitors like it
 
2:02 PM
For what it's worth, CBSK does it like B too
 
CBSK?
 
CSBK* sorry
 
Ok... CSBK??
 
Ahhhh
Very nice
 
2:04 PM
Check around on a few other motorsport sites and see what their style is
 
I feel as a motorcyclist that I should have known what CSBK meant
Head low
next topic?
lol
Will do Cameron, Thanks
Yet to be modified A
Looks clunky
and causes display issues
 
2:34 PM
hemlo o/
 
@Stuart I have a question. I've seen you post this website over the years. Do you not think that the UI upgrade in terms of CSS would go WAY further than doing little things like dates?
It's been the same ever since I remember
And honestly, it looks kinda 2004
 
V.7
2:51 PM
Anyone :)?
 
@KamilSolecki 2004 is the new 2020
get with it, man
 
3:05 PM
When you spend 2 days writing a program and you realises a big part is missing, and the big part missing makes the program useless, and you realises that you could have thought of the big part missing before writing the program.....................
At least i learned some new things!
 
3:16 PM
That's why waterfall design needs to make a comeback.
If you'd spend 6 months designing the entire program on paper, you never would have wasted those two days.
 
V.7
Why would Angular's ng-init do not run function from scope?
scope is 100% visible
 
@user220944 to me, it seems as a poor software engineering 😕
 
Yall are gonna love this:
@KamilSolecki Have you seen www.google.com ?? It looks 1999
You know what sucks? I just learned that A nor B with "th" is correct
Sry but I thought my CSS was brilliant
Noones template and works from Windows XP to present
"Gracefully"
 
V.7
Check out bootstrap at least
 
Already have, No thx, Just another dependency
 
3:31 PM
@user220944 You are on to something there, but 6 months is to much for a software that takes 5% of that time to make lol.. I would have discovered the big missing part in the "requirement" process of the waterfall design, even before planning software architecture
 
are you using this google? @Stuart
 
+1
 
Months of software development will save you days of planning.
 
"months"
 
I just spent the morning learning how to write "months"
TaDa
The correct way of writing a date
No "th"
etc
 
3:41 PM
Schedules generally have days of the week
 
It does
 
if we switched to the 13-month system, all months would be the same size, 28 days
 
That'd be alright...
 
how about no
 
lol
 
3:43 PM
@Stuart Yours definitely doesn't
 
How do you figure?
First one for instance May SIXTEENTH, 2020
 
That's not a day of the week
 
clear as day
 
> days of the week
 
Monday is
 
3:45 PM
Mmmm
September Monday the 21st to Thursday September the 24th seems like a mouthful
I think September 21 - 24, 2020 is JUST Right
especially a mouthful to hang over every race
 
@Stuart what im trying to say is, that your menu buttons look like a woman with heavy mascara on cried for the entire night
 
LMAOOOOO
Yea... They could probably use a little style help. Come to think of it, Those exactly havent been touched SINCE 2004
Been on more important code
ie: what you see
Plus, That'll be ez to revisit someday but I feel sorta uninclined with 0.00% Bounce rate on a lot of pages
and its not a reporting error
some pages BOUNCE like a MF'er
but I think thats b/c they get their info and leave
ISK this page's BR off top of my head but its <= 30
20's
(Gonna be adding pics throughout site coming soon)
been busting ass coding adn doing what NOONE, Not with a Million dollars in hand could top
ie:
Google: "Motocross TV Schedule"
or Supercross TV Schedule
ie: I got away from em and noone will ever catch, match or beat me
I guess the industry thought I was gonna be a copy paster promoting OTHER peoples work like so
Google: MotoXAddicts
 
Tbh if you have 0.0 bounce rate then you better check your analytics
Cause that ain't right
 
Nope,, Yep
See note about other pages
all sharing same Google Analytics code
in same file
 
:monkaGiga:
 
3:55 PM
What do you have bounce rate configured as?
 
There are a LOT of "Bitches" out there sharing industry giant's "Cinemagraphic" videos. Being laughed at by those whom are CREATING such content
I admit:
I usta be guilty of this
but when your entire site turns out to be nothing but "Monster Energy" or Red Bull's's created content (videos) You're an idiot
and they are laughing at ur dumb ass
You see... Thats where I changed it up. That's not me
and I got away from those whom never thought Id amount to another one of their bitches
which of course they dont give video sharers the sweat off their balls in return
NOT Me
Infact I have Deliberately NOT provided any mention of Main series sponsors and supporters
I tried reaching out to these people (after sharing their shit for a year+)
and NOONE would give me the sweat off their balls
 
I can give you some
 
I saw teh light
and did some shit noone ever even thought humanly possible
Thats WHY they dont give anyone the SOTB
 
good for you man
 
They thought NOONE will ever do what I did
 
4:02 PM
but also chill :D
 
Thank You
IM chill
Merely boasting atop the podium
I feel great
Euphoric
Anyways... So thats how you write dates. Now I have a 100+ to correct
ttyl
 
morn o/
 
V.7
Morn
So, could anyone suggest why AngularJS does not run a function on ng-init attribute, but {{test}} shows a value from scope?
I mean, for example, <div ng-init="inittest()"> does not work, but {{test}} shows value with scope.test = 1 set
scope.inittest = function() { alert (1); } exists
Controller is assigned
 
o/
 
4:46 PM
Hi there guys!
 
hemlo
 
Do someboody of you know what is the best way to write babel configuration
I correct my self.
 
So Im working on modifying this solution to toggle children instead of parent. https://stackoverflow.com/a/42307807/1898965

But `element.children().css({display: 'none'});` hides it forever, I tried `element.children().toggle();` But it didnt work. Is there a way to do this or do I have to wrap it with a if statement to check display each time?
 
just write a .babelrc
 
I have 0 experience in this stuff so any help would be super cool :D
 
4:50 PM
If I have a webpack confi thats stands inside /build folder
and I wrote a nice babel.config.js file that stands in the root
 
I believe also the app I am in is using a 1.5.3 version of jquery so maybe that is why it wont work? Is toggle a newer call?
 
The question is: if I run my webpack build command, that obviosly use babel loader inside, will the loader "look for" the configuration that stands in the root directory?
 
there's only one way to know, try it :)
 
HAHAHAHAHAAH
It definately is the shortest way
 
@KostyukRostyslav Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it. For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
 
4:55 PM
     module.exports = function (api) {
	api.cache(false);
	const presets = [
		[
			'@babel/preset-env',
			{
				debug: true,
				useBuiltIns: 'usage',
				corejs: 2
			}
		]
	];

	i

	const plugins = [
		// '@babel/runtime-corejs2',
		// '@babel/plugin-syntax-dynamic-import',
		// '@babel/plugin-syntax-async-generators',
		'@babel/plugin-transform-regenerator',
		'@babel/plugin-transform-async-to-generator',
		'@babel/plugin-transform-parameters',
		'@babel/plugin-transform-arrow-functions',
		// '@babel/plugin-transform-runtime',
this is my configuration, and I am not sure it was "assembled" correctly
 
So this seems complicated. Is there way around it? It works just seems like there is a better way.
app.directive('hideParentOnClick', function () {
  return {
    link: function (scope, element) {
      element.on('click', function () {
        if(element.children().hasClass('hidden')){
          element.children().removeClass('hidden');
        }
        else {
          element.children().addClass('hidden');
        }
      });
    }
  }
});
 
5:59 PM
RO's do you want to wait a couple more days on this or can we move forward?
 
Hmm how long you recon a "store" cookie that stores the consumers basket should last? - Until session ends or longer?
The problem is: the items are reserved the moment they enter the basket, and stay reserved for quite some time (few hours). Yet it's obviously impossible to notice when the consumer "moves away" from the current session to release the items.
On the other hand: keeping the items is an obvious privacy problem, as then people can see what other have browsed for.
 
6:15 PM
15 min of inactivity @paul23
 
I'm not sure where the privacy problem is
 
It's also mostly not a problem, except once or twice a year when items are sold within minutes.
 
How does an item sitting in my shopping cart allow anybody to see what I've browsed for?
 
@user220944 if another user uses the pc they can see in the cookies what has been browsed for.
 
6:31 PM
I'm assuming you are talking about a kiosk?
 
@JBis what do you mean?
As in the location the pc is used? Well that could be anything, I'm not deciding for the end user what is being used.
And since it can be anything I make the front end part as if it runs in the most dangerous environment.
"public library"
 
Unless it's specifically a kiosk program you don't really need to worry about it
 
So in that sense any cookie should basically be "forever"?
I mean, I cannot think of any other reason to make a temporary cookie (over using just javascript as storage).
 
04:00 - 19:0019:00 - 00:00

« first day (3390 days earlier)      last day (1541 days later) »