« first day (2316 days earlier)      last day (2646 days later) » 

12:00 AM
@tereško I think thats a good approach, assuming that the input fields are highlighted red on focusout event if they are invalid
 
well, passing the name in the definition of directive would help
@Mosho how can I pass the value from directive in the controller?
(the controller is ES6 class)
 
inject the controller in the directive
 
you mean, not with:
let directive = () => {
    return {
        controller: 'FooBar',
        controllerAs: 'auth'
    };
};
 
So many ways to style react components--I can't decide
 
@tereško you could do that if you want an instance of the controller per instance of the directive
but if it's a global thing (it sounds like it) then inject it using angular's DI
 
12:05 AM
and what if I want to share the controller?
 
it sounds more like a service really
 
how would directive's definition look like?
the current full code is:
import angular from 'angular';

let directive = () => {
    return {
        restrict: 'E',
        templateUrl: '/templates/forms/login.html',
        controller: 'Identification',
        controllerAs: 'auth'
    };
};

export default angular.module('directives.forms.login', [])
    .directive('acLoginForm', directive)
    .name;
how could I share the Identification controller with some other directives?
 
hmm, I don't remember a string as "controller"
 
well .. it works
 
where is it defined
.controller('Identification',...) etc.?
 
12:08 AM
in app.js
angular.module('app', [-- stuff here --])
    .config(routing)
    .controller('Identification', Identification)
    .name;
 
interesting
 
I think it already goes though angualr's service locator (I refuse to call it DI)
 
let directive = () => {
    return {
        restrict: 'E',
        templateUrl: '/templates/forms/login.html',
        controller: (Identification) => {/* do stuff */},
        controllerAs: 'auth'
    };
};
should work as well, note that you need controller: ['Identification', (Identification) => {/* do stuff */}], if you do minification without some other solution
 
@Mosho wouldn't that force the controller's logic within the definition of directive?
 
each directive will come with an instance of that controller, but the injected Identification should be the same
 
12:11 AM
wont work
 
I haven't tried doing that (I would use a service) but if it works the way you are already doing it then I assume it will work
 
the directive is in a separate file (ES6 module)
 
@tereško Warning about using RGB colors, etc.
 
it wont see the Identification from that scope
 
Just regular warnings. The strange thing is we see them in some cases but not others on both operating systems.
 
12:13 AM
@tereško it's injected into the controller by angular's DI
into the directive's controller
 
only with the controller: ['Identification', (Identification) => {/* do stuff */}] syntax
 
no, it's injected without it too
it's magic
 
it cant
 
it can and does
 
unless it rewrites my code
 
12:15 AM
it's an argument of the function
angular calls it
it can do whatever it wants with it
 
how does it know with which argument to call it?
what the magic string does in controller: ['Identification', (Identification) => {/* do stuff */}]
 
it parses the function arguments list
though they recommend avoiding it for the reason I mentioned
 
<div class="fieldsend" ng-class="{fieldsend_error: $field == 'email' || (forgot.email.$error && forgot.$submitted)}">
fucking angular
 
yeah I would avoid all that stuff
it feels good maybe at first
 
but I also dont want to grow my controller code
:(
 
12:22 AM
why not?
 
because the old code had controllers with 800+ lines
 
then split it, but not into an html template
in the end you have to put it somewhere
 
you mean - make a validation service
that could work
 
and writing it as text in an html template is the worst option
 
so, you solution would look something like:
<div class="fieldsend" ng-class="{fieldsend_error: errors.email}">
 
12:29 AM
templates were not a good idea multi character strings would have been a good idea
 
can an angualr directive add attribures to the tag to which it was bound
 
ORM for Redis in Node?
Or just write mapper by hand?
Also, how does one handle multiple rows of data in the singleton pattern?
 
12:53 AM
@tereško for example, yeah
@tereško yes
all directives have references to the element
 
for some reason, I cant manage to pull out data from an attribute of a directive
 
what do you mean
you can use attrs (3rd argument to link function)
there is also an injectable for the controller I think
 
and it seems to be failing
not only it doesnt add any variable to scope, but also fucks over the existing variables
 
1:16 AM
hmm ...
got it working
 
cool
 
not I only need to figure out an interface for validations service
... and its 3AM
 
 
2 hours later…
3:06 AM
wtf lol
my windows doesn't have any bluetooth anymore
no bluetooth settings, nothing
facepalm
 
is there any easy ways to keep track of time played? or would i have to do it all manually
in node js
 
3:27 AM
OMG GUYS
 
is that a game
 
It's a data science competition, first prize is $30000
But it just started today, I believe tomorrow I'll be in place 100th
 
wait, ur rank 1
 
3:30 AM
yeah
 
well i have no chance so no point me doing it lol
 
3:42 AM
am i doing something wrong, one logs 41 and when i try log it again, it logs undefined
Server.prototype.updateDatabase = function(userId, userName, kills, deaths, score, time)
{
	console.log(time); //returns 41
	connection.query({
	sql: "SELECT * FROM users WHERE username = ?", //See if the user was playing on an account or guest account
	values: [userName] },

	function(error, results, fields)
	{
		if (error)
		{
			console.log(error);
		}

		if(results) //If they were, update their stats
		{
			console.log(time); // returns undefined ---
 
3:56 AM
@RachelDockter if you put console.log(time) outside if(results)
does it return something?
 
@RachelDockter Don't drop your curly braces to the next line. This isn't java
function {
    ...
}
if {
    ...
}
 
Anyone familiar with Babel?
 
user6820627
@JamieLester a lot. just ask.
 
omg SO bar changed
 
4:38 AM
hi
 
0
Q: Using Javascript to pass a parameter from a URL to a hidden form field (Gridview)

Ratheesh PalaniHow to pass Hidden Field JobID Value From javaScript I wasn't to be able to pass and ID such as 3017 from a URL(JobID): http://www.company.winrecruit.com/JobDetails.aspx?Key=3017 Please Help Me ...Sorry for My bad English.. Any ideas much appreciated! <asp:GridView ID="gvJob" CssClass="gvSt...

 
really quick question.. i seem to have forgotten
is the head of an array the array.Length
or is that the tail
 
5:04 AM
wat
 
why this is not working? jsfiddle.net/yea9jysh
 
@KevinDuke Neither. It's the length of the array.
If you want to access the first last item in an array, you'd target with arr[arr.length - 1]
 
can someone help me with this? stackoverflow.com/questions/42289763/…
 
1 message moved to Trash can
@SKG Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
SKG
Can you tell me why is
 
5:23 AM
1 message moved to Trash can
@SKG Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
SKG
I am looking at the Jquery Source code of $.each(). It says:
if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
break;
}.

Can you tell me what is the logic behind conditional statement? Does call() return Boolean?
 
call just invokes the method
It is expecting the callback function to return something other than false
 
6:09 AM
@SKG call invokes the function (callback) on first parameter (obj[i]) passing in the remaining parameters and return the result of that invocation. It may or may not return a boolean - it depends on the function being "called".
@SKG And if does not need a boolean to work. You can if a string, a number, or an object.
 
 
1 hour later…
7:21 AM
<div class="active myclass"></div>
how do i select the div with multiple classes as above?
 
@new_user Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@new_user .active.myclass <-- w/o space
 
Thanks. Got it :D
 
7:58 AM
@copy nothing wrong with bitwise operators my fellow fool
 
8:10 AM
^ I wonder why he said that
 
8:28 AM
Morning! (or Afternoon/Evening depending on your location)
 
8:45 AM
!!moo
 
@FlyingGambit That didn't make much sense. Maybe you meant: foo
 
!!cowsay Good Morning
 
 _____________
< Good Morning >
 -------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
 
@Cerbrus your code can be more efficient
 
@KarelG hm?
 
Ah yea
I'm sure it can be
At least it's not using .some as some sort of shortcut loop iteration method.
 
she's abusing the purpose of that function IMO
 
She's got a habit of writing code like that
Incomprehensible, but somehow, it always works.
 
Hi got issue with jquery not defined. But it's loaded before every other script too
anyone know what 's wrong?
 
Yes, it's not defined because things aren't loaded as you assume they are
 
9:11 AM
When people make repos, do you prefer names like e.g. CamelCase or Camel-Case?
 
Hi
What am I doing wrong here ?
$('button[name="removeDvdProj"+i]').on('click', function(e){
...
some syntax I guess
    for (var i = 1; i < 1000; i++) {
        $('button[name="removeDvdProj"+i]').on('click', function(e){
 
the i here is the string, not the variable itself
 
$('button[name="removeDvdProj' + i + '"]') ?
 
how do I put it as a variable in this caser?
 
What do you mean the i is not the variable?
 
9:13 AM
ty ill try
 
use 'button[name="removeDvdProj' + i + '"]'
 
is there something equal to exit/die() in javascript like in php?
 
In a loop? you can use return
I think think a return will break out of the loop?
or there's break;
But I'm not sure if thats only applicable to while loops
 
using that in PHP is quite dirty
break works in while
 
What license are people using for Open Source projects? MIT?
I really dont understand this license stuff, to much info!
 
9:31 AM
it really depends, but if you really don't care, go for MIT (which most people uses. Even jquery uses it)
 
if I set an input text value to 0 how can I go back to the default value?
or better the value it had earlier
 
Is this room dead ?
 
!!tell FlyingGambit sandbox
 
@FlyingGambit Please go and play in the Sandbox
 
9:45 AM
@Riccardo you can use placeholders for "default" value.
 
I just settled with MIT in the end :)
 
!!facepalm
 
Nobody is flipping the table
 
!!facepalm
 
9:47 AM
Today is Friday
 
@KarelG what do you mean with using placeholders?
 
!!undo
 
testing
!!undo
 
@FlyingGambit I'm afraid I can't let you do that, Flying Gambit
 
@Riccardo <input type="text" placeholder="I am a placeholder"/>
 
9:49 AM
@CapricaSix Bish
 
@Munkie placeholder is the right choice then
placeholder displays a short hint in the input text and I don't need that
 
errr... i'm not productive today (slept 3hours only)
if you have an input with a default value, you can put that as data-attribute and retrieve it from that
or store it somewhere in js
 
the problem is when in a condition I set it to 0
if I set it to 0 I can't go back to the previous value
 
HELP!! I cant find the command to flip the table
 
10:15 AM
@FlyingGambit you can do table flipping with CSS3 - jsfiddle.net/z60prw7t
 
^ WTF
!!put..it..back...ლ(ಠ益ಠ)ლ
 
┬─┬ ノ( ゜-゜ノ)
 
Haha I'm kidding :)
 
I know a website called "safaribooksonline". Here the word "safari" has nothing to do with the safari browser, doesn't it?
 
^ Nope, SafariBooks is owned by O'Reilly
 
10:29 AM
What does "safari" mean here? I googled and found it's an existing English word.
It somehow means "hunt".
 
@ZhengquanBai It's a wildlife trip
 
you can use a dictionary or a translator ...
"wild"life trip yeah
 
Does anyone use Slack and know of any cool Slack channels?
I'm registered with this SO chat and a few channels on Slack but they're quite inactive :(
 
We have slack at work, but at some moments it ruins the productivity because a discussion or funny talk is happening and lots of co-workers is paying attention to that
keh, I allow them to do that. The workplace doesn't have to be serious all the time
 
10:36 AM
Yeah we use HipChat at work and it's the same
I am at work right now on HipChat, here and Slack
 
do you work ?
 
Yeah I am a JS dev, do you?
Although right now im writing a README for a personal project
 
is there an opposie to this: $form.trigger('submit');

not to submit ( to cancel=
 
@Munkie I work when I am not chatting
 
You can do e.preventDefault() in the event listener
 
10:54 AM
@JohnDoe2 You can use the backspace key on your keyboard to correct typing mistakes before sending a message
This works equally well for coding and text-based, inter-human communication
 
window.stop();
 
@Zirak the ASLR attack is really interesting
 
@KarelG that's offset by the really useful integrations and bots that help keep everyone on track :D
 
11:12 AM
Do we have any mega AngularJS guru here :)
 
@Mathematics No.
 
ok, AngularJS guru might work too then
if any round ?
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
default.aspx
HTML1300: Navigation occurred.
mysite
DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
default.aspx
 
@FlorianMargaine they started from an interesting idea though
 
@Mathematics You called?
 
@Mathematics ^
 
11:28 AM
@OliverSalzburg AngularJS directive isn't triggering sometimes but I am not getting errors
only thing I get is above info
when it happens I get DOM7011 twice otherwise only once
and it is happening randomnly 1 in 10 tries when I reload page
 
I'm a bit confused with APP_BASE_HREF with angular2. I used base tag in index.html, but seems like now its not working anymore and I use APP_BASE_HREF variable in providers for module. But, now, I do have a real url to project like website/customfolder/PUBLIC, and when using the application, I do have this appearing in url : website/app_base_href/customfolder/PUBLIC ... So, can anyone explain me how to get my real folder in url please?
 
@Mathematics What do you mean by "triggering"?
Also, this seems to be an IE/Edge issue and is thus by design
 
@OliverSalzburg yes, it is, because it is working fine on other browsers
@OliverSalzburg this developer created a resize directive in angular, which resizes some window and component inside it on resize
now this app is running in SharePoint (I know it's a put off..) but I am not to track the problem
 
So you have an Angular app, in a SharePoint site in IE?
Have you considered suicide?
 
@OliverSalzburg no, against my belief :P
 
11:42 AM
Okay, then let's do the next best thing and look for a solution
In general, I can't see a relation between your problem and those warnings
 
Hello guys
 
@AllTheFish Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
@OliverSalzburg ok, let me see if I could find something else
 
I added a md-button to md-tabs see here: http://stackoverflow.com/questions/42296228/cant-bring-md-button-to-foreground-in-md-tabs

The problem is when I add enough tabs, they start to disappear behind the button, just as the arrow which scrolls through the tabs.

Is there a way to constrain all tabs to the left of the button?
  <md-tabs class="" md-selected="selectedTab" md-align-tabs="top" md-border-bottom md-autoselect md-dynamic-height>
    <md-tab ng-repeat="status in statuses">
      <md-tab-label>
        {{status.name}}
        <md-tooltip md-direction="bottom">
          {{status.description}}
        </md-tooltip>
      </md-tab-label>
      <md-tab-body>
        <md-button ng-click="removeTab(status)">Remove Tab</md-button>
      </md-tab-body>
    </md-tab>
    <md-button class="superclick">Superclick</md-button>
 
what can i do? how can i solve this issue ?
 
11:54 AM
The ASP.net chat room might help you more
 
Okay Sir Sorry @FlyingGambit
 
@IvinRaj I am just saying because the probability of getting an answer is more there
 
@IvinRaj The error message couldn't be clearer
 
^ Just noticed the connectionString is null :D
 
<connectionStrings>
<add name="constr" connectionString="server=example.com;UID=CRM_Fluead;PWD=2009;database=VanCRM_Fluead;Connect Timeout=600" />
</connectionStrings>
 
12:06 PM
@AllTheFish Tip: Don't
Someone with bluebird/promise knowledge better than mine please explain this to me:
I would expect that the promise returned from Promise.reject would return true for isRejected()
Ah, it works without .reflect()
I guess I don't really understand .reflect()
 
12:23 PM
what hackaton
oh
 
Can someone tell me what I need to do after downloading a node module that only contains a index.js and generate.js file?
 
require it?
 
@BartekBanachewicz I dowlnoaded an npm package called 'FontAwesome" and normally i'd just use the /dist folder, but it looks like that is not a common practice anymore..looks like many publishers/developers are just creating an index.js/generate.js file these days.
Is there something I have to do now to use a module that only contains an index/generate file?
 
@redshift Many? I have never seen that
 
@redshift I was under impression that doing require on folder name would be enough to get the index.js
 
12:27 PM
im seeing it more and more these days
 
@redshift I've never seen the /dist folder used
 
@BartekBanachewicz in my HTML template, id just link to the script.js in order to use the module
 
@BartekBanachewicz People who use babel with node love to do that shit
 
@redshift HTML template?
 
something like <script src="/dist/myscript.js'>
and be done with it
so now it seems i need to genereate the script before using, hence the generate.js file
 
12:29 PM
@redshift npm modules are actually more than a fancy zip file
 
yea
 
If you just need something you can throw into your website, you don't need npm
 
yea but my workflow sort of fits it nicely
but was just asking if i need to generate the script before using, if so, how?
i thought i'd do something like navigating to the directory in CLI and then simply typing 'generate.js' to have the software create itself
 
@redshift Probably. Have you tried running the generate.js through node?
 
usually you shouldn't have to, since the published package usually contains all the generated artifacts
 
12:32 PM
I think it's strange that the package doesn't contain a package.json
I've never seen a published package without one
 
it does have one
 
but im a newbie not sure how to handle
can you teach me oh wise one
 
It will contain the instructions for building the package
 
ok
 
12:33 PM
There is probably a postinstall hook or something like that
Which would be the command that is executed after the package is installed. It's likely to include the generate.js
 
ok so how do i 'start'
do i simply type 'package.json' in the CLI?
thats the part i don't undertand
 
@redshift Open it with a text editor
Then check the scripts section for defined commands
 
done
hummm
"scripts": {}
 
what package are you using exactly? it's super rare that you have to reach into the distributed package and manually run scripts
 
fontawesome
 
12:36 PM
@redshift That's not a lot
 
only 4 files in this package: generate.js, index.js, package.json, readme.md
 
@redshift And you're using the correct fontawesome package?
 
i possibly am not
i thought npm install fontawesome would be what i want
but may be have to be more specific
 
uhh, dunno what you expected from this package
it just gives you a map of all the FA icon names to their unicode characters
 
12:40 PM
ok so they changed it to "fort"
lol
 
@redshift No. It's font-awesome
Mind the dash
 
aha!!
lol
thanks a bunch
that was it
 
Been there ;)
 
Can someone help me to improve this code kopy.io/ywjpt it looks ugly
 
Yikes, huge font.
@JohnDoe2 try to use this:
function update(value, selector){
    $(selector).empty().append(value != '' ? value : '-');
}
 
12:49 PM
@redshift Just to sum up though. What @FilipDupanović suggested is correct. The index.js only exports a map of symbols you can use to render fontawesome glyphs into text. The generate.js us used to regerenate the index.js, which is all that is needed by that specific package. The generate.js is really just for the developer and could be excluded from the final npm package
 
@Cerbrus thanks ill try that ouzt
 
@OliverSalzburg Could you elaborate a little more?
 
@JohnDoe2 you should also be able to destructure $(this).data()
 
@FilipDupanović good point
function update(selector, attribute){
    var value = $(this).data(selector);
    $(selector).empty().append(value != '' ? value : '-');
}
although you'll probably need to pass this as well
 
something like const {id, title, createdAt} = $(this).data() should be possible; iirc, jQuery will strip the hyphens and return keys in camelCase
 

« first day (2316 days earlier)      last day (2646 days later) »