« first day (3386 days earlier)      last day (1545 days later) » 
00:00 - 14:0014:00 - 00:00

12:01 AM
Coffee
 
Kevin, do you actually use Coffee?
 
1:02 AM
hi guys
I need some help
Im working on vuejs and it's misbehaving
 
it seems to be getting slower as you make selections, what are you doing with the input?
 
because after selection, the value is a key and I'm using that key to find the name of the region etc
  methods: {
searchRegion(value, currentItem, searchItem) {
  for (var i = 0; i < this.region.length; i++) {
    if (this.region[i][currentItem] === value) {
      return this.region[i][searchItem]
    }
  }
},
searchProvince(value, currentItem, searchItem) {
  for (var i = 0; i < this.province.length; i++) {
    if (this.province[i][currentItem] === value) {
      return this.province[i][searchItem]
    }
  }
},
searchMunicipality(value, currentItem, searchItem) {
  for (var i = 0; i < this.municipality.length; i++) {
here's my code on onChange select
Basically, when I select a region, I passed the selected key to an api to get the provinces options
I'm jsut wondering why the barangay select is misbehaving whereas the code is the same with the other select
 
1:21 AM
hey I'm sure we could figure this out but I'm heading home right now so I can't really help, sorry. If you can't figure this out by tomorrow, put a MCVE into a codepen or jsfiddle or whatever, it'll make it easier for us to assist.
 
Alright thanks
 
 
2 hours later…
user9796889
3:07 AM
My issue with JS is that it is s l o w
 
@Asadefa 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.
 
user9796889
@JamesBot ok
 
@Asadefa James is in JS and has to deal with network lag and it responded pretty quickly, so whats the issue?
 
user9796889
@JBis ok
 
user9796889
Why don't browsers let me write the client in C
 
user9796889
3:09 AM
I would always write the server in C
 
You can
 
user9796889
@JBis How
 
user9796889
@JBis Is it fast?
 
"near native speed"
 
user9796889
3:10 AM
@JBis Ok then cool
 
:)
 
 
1 hour later…
4:18 AM
@Asadefa You can write browser-side code in C and export to high-speed webasm, but that doesn't mean you can do the interface in C - it is still HTML and DOM - and you are limited to very basic things. Threading is very restricted, for example.
But most people who say JS is slow, would write slow programs whether they use C or JS.
Also look at Apache vs Node. They are not directly comparable, but I am still amused how the fans sell node js.
 
user9796889
4:37 AM
@Sheepy I have experienced otherwise. In Minecraft, to switch languages like from english to french for example it takes like 10 seconds of loading. I have written a game that can switch languages... INSTANTLY. Maybe this is because I use C, or because Minecraft is terribly optimised, or a combination of both. Lol
 
user9796889
 
Or maybe your game isn't as powerful as minecraft and doesn't require as many resources?
 
user9796889
@JBis Even if it were half as powerful it would not do it instantly at equal optimisation. It would take half as long. I can do it INSTANTLY, meaning my game would need to be INFINITY less resources.
 
user9796889
@JBis Even then my game has more or less equal number of strings as Minecraft. And adding more has no noticeable effect on performance.
 
user9796889
@JBis Aslo this is unrelated to performance but having equal number of settings, my game stores them in 48 bytes while minecraft takes 3 kb
 
4:44 AM
Yeah you are probably right. My guess, you are probably a far superior developer than all the minecraft devs.
 
user9796889
@JBis I try my best, especially at performance
 
user9796889
@JBis Thx
 
So where'd you learn how to become such a good dev?
 
user9796889
@JBis IDK, I just guess it makes sense to me to fwrite bitfield structs to files rather than literally using 4-5 bytes to store booleans (which each should only take up one bit).
 
user9796889
@JBis My main goal as a dev is performance. I am bad at stuff designing new functionality. It takes me longer to add new stuff to my games, must of what I do is figuring out how to make current features more efficient.
 
user9796889
4:55 AM
@JBis About where I learn to have good performance, I honestly don't know. I just got into the habit of minimizing unnecessary code, that does nothing but slow the program down. I am just a humble programmer who focuses on performance alot
 
5:22 AM
can somebody please help me with this
0
Q: script70 permission denied ie 11 when re-loading svg

Dwight SchruteI am using https://github.com/ariutta/svg-pan-zoom/ for zooming svg images. When a dropdown is changed, I change the svg object's data attribute to load a new svg image. var imageName = "../images/svg/"+floorname+".svg"; and then set the data attribute $('#svgObject').attr("data",imageName); ...

 
 
2 hours later…
7:15 AM
Please help me with this
1
Q: opening react app should redirect to default signin page

cyberman123I have a react application where in I have implemented Dashboard and signin pages. I want the homepage to be signin. Sign In page redirects to dashboard. But I'm unable to get the homepage to redirect to signin. This is what I've tried so far :- App.js File :- const LoginContainer = () => { r...

 
7:44 AM
Hi All
i want to handle status code in a nodejs api.
What is the best practice to cover as many status codes as possible?
im checking for the conditions like if the credentials are incorrect then a certain status code.
Is this conditional check approach the best practice
 
@JBis lol the conversation around that specific comment.
 
Hi is any best js Lib that convert docx to Html ?
 
docx to html?
 
I did not have tried that. I would just google it and if there are multiple libraries, try out some of these
 
7:50 AM
in this images and tables are sometime disturb
any idea
 
> I did not have tried that.
the docx is a rich writer environment. It is tough to convert it to html nicely
I think that LibreOffice writer allows you to save documents as html documents.
but programmatically converting it to html?
 
not downloading i wan to use preview
preview in popup
?
 
@RaheelAslam assalamu alaikum
these word documents are random docs or some specific formats?
 
8:40 AM
@Asadefa You gave a good example. Changing a language takes 10 seconds is most likely because the program is not / was not designed for switching language, instead of because the language is slow.
BattleTech, for example, was not developed with i18n in mind. To deliver on their promise (late), they had to rewrite every line of code that touches a displayable string. (And breaking a number of mods in the process, yeah.)
 
it is just poorly designed
BAAAAAH @Sheepy
how's the little sheep now?
he's 3 years atm right?
 
Yes! He is three years old now. Physically healthy.
 
ready for school? :P
(kindergarten was the word I was looking for 🤔)
 
Mentally, I've been suspecting him of autism spectrum disorder since 1. Most family members disagree. His case escalated steadily and slowly in the health system. Fast forward two years, now the teacher says she may need to advise him to repeat a year, and urged us to get a diagnosis asap.
I wanted him to stay at home with the bigger family, instead of going to the Nursery, at first (before 1). But because of the suspicion we signed him up for a Nursery. The teacher there thinks he is fine. He just moved up to Kinder last year. Suddenly it is not so fine. Same school.
Anyway. We are expecting to be able to bring him to specialist doctors on March, one way or the other. We'll see.
Oh, he like computing very much. He has two full sized keyboards, and would plug them into drawers, pretending the drawer is a computer, and type. He is also learning to use trackball. Yeah sorry there is no mouse.
 
8:56 AM
you're working from home right?
probably he got it by seeing you working
 
Hi
can any explain some code please
 
@Ayaz 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
 
@KarelG Yes. He sees me code, shop, and game from the computer. I also loaded his early education materials into my computer. It is rare to find a child that prefers computer over phone today!
 
function fearNotLetter(str) {
  var allChars = "";
  var notChars = new RegExp("[^" + str + "]", "g");

  for (var i = 0; allChars[allChars.length - 1] !== str[str.length - 1]; i++)
    allChars += String.fromCharCode(str[0].charCodeAt(0) + i);

  return allChars.match(notChars)
    ? allChars.match(notChars).join("")
    : undefined;
}


fearNotLetter("abce");
for loop and below that
 
But no, I don't really work from home now. He is too sticky. And that is when he was less attached to me. Now I work two days a week. And my doc recommended me to go back to work to recover from then-depression.
@Ayaz Ok. How much do you understand?
 
9:03 AM
we have created 2 variables one has all chracters and others dont have strings
 
@Ayaz grab a pen and paper, start with a random string such as "hello" and execute the code manually?
 
The function is not designed for random strings, so don't do that lol.
 
for loop iteration start with 0
i know String.fromCharCode()
but allChars[allChars.length - 1] !== str[str.length - 1] is confusing
 
what should be my structure of a react app designed to consume apis
?
these apis are from a backend service
and we need to migrate from angular to react
 
allChars += String.fromCharCode(str[0].charCodeAt(0) + i) means all chracters include strings from start and chracter code 0 plus iteration
 
9:06 AM
stop it!
 
why return has match twice?
then
 
@Ayaz allChars[allChars.length - 1] is just the last element of that array
 
@user123 Mind that we were talking with Ayaz before you came; you are the one interrupting here. With a pretty generic question.
 
Err.. okay
 
-1 doesnt mean element before last element?
 
9:08 AM
@Ayaz The loop will build allChars letter by letter, "a" "b" "c" etc., as long as its last character is not the same as the last character of the input.
So if your input is "abce", allChars would be "a", "ab", "abc", "abcd", "abcde", and and stops before next loop.
Then, all characters in the input is removed from allChars, through notChars. Thus leave "d".
 
ok thanks but i am confused about code
 
@Ayaz the [...] is used to access a key or index of the given array. The index count starts from 0. The length is the number of items in it. A string is essentially an array of characters. so 'hello' is actually ['h', 'e', 'l', 'l', 'o']
 
str[str.length - 1] what does this mean
 
string: ['a', 'b'] --> length is 2
index: [ 0 , 1 ]
@Ayaz same: get the last element of str
 
@user123 React apps are usually organized by screens, but you are free to organize your code as you want. Last app I made, I have all screens in one folder, and the api bridges in another, with the data model in a third. I linked them through import.
 
9:12 AM
@SamSam random heading images video table or any thing in document
 
if your string str is 'abc' then str[0] gives 'a', str[1] gives b, ect
 
@KarelG yes this i already know its basic
 
now do str[str.length - 1] with str= 'abc' then you have str[3 - 1] (length is 3) which then is str[2] and therefore you get 'c'
 
great
ok why two match returns?
 
@Ayaz practise some logic codeforces.com :P
 
9:18 AM
Yeah that is bad, inefficient code. Good code have one match.
 
@KarelG?
 
you cannot .join on undefined.
otherwise 💥
@RaheelAslam yes? o.o?
ah right that word to html
 
@user123 thanks for advise i m doing practice but here i m trying to understand someone's code for learning
 
@KarelG hahaha
 
@Ayaz e.g. ( allChars.match(notChars) || [] ).join(''), or split it into two lines.
 
9:20 AM
As I said, I did not have implemented it so far. I did have worked with a preview of pdf files but docx files?
so idk an elegant library for that
 
@Ayaz first try to write your own code, then you might know why certain thing is done that way..
 
@Sheepy different return :P (but that's slightly better indeed. returning undefined is bad)
 
@KarelG thanks
 
thanks guys much appreciated
@user123 i can write beginers level code but not complex ones right now so trying to understand others codes
 
learning how to read other developers' code is a crucial skill, I dare say almost as important as being able to code yourself
 
9:25 AM
I guess it's not the easiest code to read. There is a chance it loops forever, too.
 
most of what I write is just ligament between components written by others
 
yeah me too
 
I guess I am too far gone to turn around. Ironically, I started with RAD and only picked up my skills later. Like parsing Range header to work around server bugs, doing my own UTF converter before stackoverflow is born...
 
9:57 AM
|| mdn array.from
 
bah
 
10:09 AM
https://jsfiddle.net/willRF/p1jrch83/
this.pool.push(array.splice(i--, 1)[0]);
Does anyone know how to reduce the quadratic complexity of this? Well, it's linear on its own, but inside the loop it's quadratic.
 
@JasonStackhouse you're what, reversing the order of the array?
technically, to do the same at the end of the loop, you'd do this.pool = array.reverse(); array = [];
that should be linear time
 
Yes, basically I'm making a particle engine and I'm sending dead particles back into the pool
 
you should handle all particles in the array, then push them to the pool all at once
no need removal of each particle one at a time
that makes it O(n^2) time
 
Ah, okay. I was thinking pooling operations take time so each particle has their own random decay time (how long they are alive), to spread out these operations
 
have a object that represents a particle
give it coordinates and decay time. At each cycle, check decay moment and/or update coordinate
would it not spare you some hassle? :P
 
10:20 AM
@JasonStackhouse 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
 
    let last = 0
    for (let i = 0; i < array.length; ++i) {
        if(array[i].update()){
            this.array[last++] = array[i];
        }else{
            this.pool.push(array[i]);
        }
    }
    array.splice(last);
How about something like this?
 
I have a material expandable table with let's say 1K records. In my route state I have the record of the expanded table as ID. Now how can I automatically scroll to that record on load?
So let's say 20 records fit inside viewport, expanded record is nr 500 > on load > scroll to that record
 
Hi can we preview blob url in iframe or google document online?
I have blob url of word document and want to preview in html
 
blob urls are local, no?
 
yes
 
10:37 AM
so I've got this table holding every operation that's ever been performed for every credit card on record. It's massive to say the least
I was asked to make something which removes money from any credit card which hasn't had any activity in the past 12 months
is there any way to do this efficiently using SQL or am I boned?
it's got an index using the credit card, but the times are still astronomical
 
depends of the credit card column got indexed
that must be a huge db table
 
yes, indeed
 
create sub table with all data from that credit card
then do search on it
 
it is getting to the point where my procedure won't even run anymore because it exceeds the timeout for procedures, all due to this query
you mean a subtable on the fly? wouldn't that take just as much time?
 
try it first :P depends of the db + db engine + query optimizer
ISAM is weak on it
 
10:41 AM
I'm trying different things now
Before I was checking if there were records of a certain type in that period as an inner query
now I'm trying to extract the max date and seeing if it is less than today minus 12 months
I don't think it will be any faster though
 
although
is it not odd to remove money from such cards?
 
how so?
they're active cards that aren't being used
 
I just disable these
 
I don't pretend to understand the business logic behind it. Maybe there's a clause in the contract which says this would happen
 
could be
 
10:45 AM
sadly, this table is sort of an archive table
 
tbh I don't like the concept of credit cards
 
it isn't used for practical usage because it'd be too slow
and until now, I suppose nobody has really needed to use it
for practical usage, there's a table containing monthly operations
@KarelG you mean the fact that you can rack up debt?
 
yeah, you are spending money that aren't yours.
how are you supposed to control it correctly? Not everyone is financially literate
 
They really should teach everyday finance in school. And I don't mean how to recognize bills.
 
There was a comment on reddit recently where someone knows other (whom works for the US army) that acquired a new ford mustang by credit notes and is paying by a monthly subscription with 24%
 
10:49 AM
they bank on the fact that many people when given the possibility to spend money, can and do
the world was simpler when you could withdraw money until you had no more money left on your account
 
he can certainly not afford that mustang and will go in debts in the future. But he is not aware of that and could pay the bills on short term because the credit card allows it
 
now there's this hole that only gets increasingly dark as you go down, with no bottom
const a = {0: 1, 1: 2, 2: 3, length: 3};
Array.prototype.reverse.call(a);
console.log(a);  // {0: 3, 1: 2, 2: 1, length: 3}  WTF?
 
11:05 AM
it is generic
your object represents an array. So it is ok
that assignment, yeah ... this binding ...
 
You have an odd definition for "ok"
 
it is more "I can live with that"
 
not that we really have a choice I suppose
something could be said for trying to make functions work in situations where they wouldn't normally be considered being used
 
arrays are objects with numeric keys.
 
C++ did this kind of coercing a lot, and while it had its high points, for the most part it just made errors that much more difficult to spot
@KarelG well again, more of the same ultimately
they could have internally been the same but outwardly distinguished them
but they choose not to
 
12:08 PM
Hey could I get someones opinion on the calculations I use to make this canvas clock: codepen.io/SkylerSpark/pen/QWwzmNK
Im getting Hours/Minutes/Seconds by running an interval every 1 second
setInterval(function(){
 hrpos += 0.00001666666;
 mnpos += 0.001;
 scpos += 0.06;
}, 1000);
each is divided by 60 to slow it down
rather than multiplying by 60 to represent its actual count
 
@TaylorS yeah don't do that
 
hrpos is hours, mnpos minutes, etc
 
after each interval, calculate the hrpos, mnpos, and scpos based on the current time
 
Is there a better way I can do this, im completely and utterly confused
 
if you do it like this, the errors accumulate
 
12:10 PM
I tried going off real life time
just didnt go well
 
that's the proper approach though
 
I dont really understand how to do so
 
well ok, that has nothing to do with it being a good approach or bad approach
 
Well yeah, I didnt think it was a good approach lol
I sorta just fiddled with it
until something looked real
 
you should be able to take a time and know exactly how to calculate the second hand (that's easy enough), minute hand, and hour hand
everything else is just drawing it
 
12:12 PM
But how do I calculate "whole number (being time)" and turn it to "degrees for rotation"
 
I think you're trying to test the finished product, and that's where you're messing up
you need to be able to test each component individually
 
ok, lets start small, how would I convert Seconds to Degrees
Once I figure out one of them, I think I can do the rest myself
 
well if you exclude the possibility of the minute hand being in between minutes and the hour hand being in between hours, it's quite straightforward isn't it?
so start with that, then figure out how to add that additional angle based on the current minute/second
hint, it should be an angle between one tick and the next
 
hmm, well I originally went off this idea: Get date(), then render that to Milliseconds, and then have 3 intervals, each increasing the rotation by a specific value, every (milliseconds)
I feel like that would "work" but I still also feel like theres a more professional approach
I have 86,400,000 Milliseconds to work with
I think I got the basic idea
 
wait wat?
so if you have 86,400,000 milliseconds, you add a tick 86,400,000 times?
just use multiplication if anything
also, you should consider that the number of milliseconds since the epoch may not give you an accurate date..
make it work using the current hour, minute, second..
if you prefer, you can convert that to number of seconds since the beginning of the day
don't work with milliseconds..
 
12:24 PM
I think Im just going to go with this idea:
setInterval({}, 1000);
setInterval({}, 60000);
setInterval({}, 3600000);
Add a degree (im going to adjust based on the rotations of a real clock)
:P
Trust me dude, I wish I had another idea, but your just giving me a concept, I dont know how to write that concept
 
It's not a concept, it's quite straightforward
literally write function getAngleOfHourHand(hour, minute, second), getAngleOfMinuteHand(minute, second), getAngleOfSecondHand(second)
Get the hour, minute, second from the current date, and call these functions.
 
but how do you convert Hours, Minutes, and Seconds to an ANGLE
;-; confused dude
 
you don't even have to worry about the minute or second hands for the hour at first.. just return hour*360/24..
 
.-. I already saw that equation, and did NOT go well
 
so hour 0 will return 0 degree.. hour 1 will return 15 degrees..
 
12:31 PM
im not even sure how, but it moved my clock hands off the clock
even with the clock origin in the pixel center of the screen
 
well by all means, continue your way. It seems to be going splendidly
 
Dont gotta be rude now, mocking isnt helping
 
just being frank
if you believe I know what I'm talking about, but you don't understand it, maybe the thing to make it work, and more importantly, understand how to write such things in general, is trying to bridge that gap
 
Well your doing what I originally wanted help with atleast, your giving me materials to work with, not just a concept
 
it's not an attack on you personally
nobody is born knowing how to do this stuff. like everyone else before you, you just have to reason through it
hah see, I made a bug myself
It should be hour*360/12
 
12:36 PM
Ok, I see what was wrong
 
because on hour 12, it needs to be back at 0
 
I used that equation before, but my clock origin was set to canvas.width x canvas.height (meaning it was rotation around the bottom right corner)
well if your going by the same concept for minutes and seconds, what would you divide by for minutes and seconds
60?
 
well what do you think would change here?
360 is the 360 degrees of a circle, right? that isn't going to change
what is 12?
we're talking about hours here, so that's probably (is) the hours on a clock
 
half a day .-.
 
so for minutes, you'd have 60
if minutes is 60, 120, or 12000, it doesn't matter
 
12:39 PM
so I was right, and for seconds im guessing 360
 
it is the same position on a clock
no
minutes moves independent of the current hour
if anything hour position changes slightly for minute position
 
just divide by the total number of (minutes/hours/seconds) and then multiply by 360
60 minutes in an hour
||> 15/60 * 360
 
@JBis 90 Logged: ``
 
AFAIK I transformed it to radians to get the right angle
:P
 
codepen.io/SkylerSpark/pen/VwYgQqx Um, I created the top variables for it, but now its highlighting my "canvas" selector and calling it an unexpected identifier, codepen is giving me an error, no errors in Standalone JS Console
 
12:41 PM
boom so 15 minutes is 90º
 
JSHint says its fine
 
and you can convert to radians if you need
 
I have made a little analog clock in js earlier. Must be one of my old svn projects
 
if you focus on getting your method to return the proper values (indepedent of whether you need degrees or radians, as long as it makes sense to you), then that's what counts
if anything, you need radians, so you create an additional function that converts degrees to radians
 
Neil, do you have an easier method than the one I suggested?
 
12:43 PM
Im still getting the error above with no solution, cant find any info, only codepen is giving me the error, and its not rendering the canvas
could we solve the error first before getting more into the clock code
 
@JBis nope, that's pretty much what I was suggesting
divide by the number of minutes/hours/seconds that make up a full turn, then multiply times 360
 
heh I have this for the hour arm
	Time.prototype.getHourEndPoint = function() {
		var angleInDegree = (1/2) * (60 * (this.hour % 12) + this.minute);
		return this.getCoordinate(angleInDegree, _clock.HOUR);
	};
 
@KarelG 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.
 
so 0-23/24 should get you a percentage of a full turn
 
Yepo Neil. @TaylorS does that make sense to you?
 
12:44 PM
you're basically converting a percentage of a full turn to degrees
@KarelG why divide by 2?
 
IM NOT WORRIED ABOUT THE CLOCK RIGHT NOW
Because the canvas wont even render
 
@Neil degrees
12 * 60 (minute) gives 720 which needs to be halved to have a full circle
so you have 30 for 1h, 60 for 2h ect
 
@KarelG oh that's true
 
I also find lots of things online like this:
  //hour
  hour = hour%12;
  hour = (hour*Math.PI/6)+(minute*Math.PI/(6*60))+(second*Math.PI/(360*60));
  drawHand(ctx, hour, radius*0.5, radius*0.07);
  //minute
  minute = (minute*Math.PI/30)+(second*Math.PI/(30*60));
  drawHand(ctx, minute, radius*0.8, radius*0.07);
  // second
  second = (second*Math.PI/30);
  drawHand(ctx, second, radius*0.9, radius*0.02);
 
ah that allows you to adjust for minutes too
 
12:49 PM
All these different equations are different, all cause different problems
It seems the more I "improve" the code, the more errors it gives me
 
you should be reasoning through all the code you add
 
Hmm so 60 minutes is 30º
 
it's not going to just magically work unless you're incredibly lucky
code can be both correct and not be compatible with your existing code :P
 
so i guess it would be const hourHandDegs = ((hour/12) * 360) + ((min/60) * 30)
 
why are ya adding the minutes?
 
12:53 PM
because an hour hand can be between hour ticks
 
What about when you want a "smooth" moving arm
 
I wanted you to think about that after the fact, because it's a needless complication if you're goal is to understand
 
Ive seen some clocks IRL that dont "tick" but smoothly move constantly
 
that's how you get a smooth moving arm
unless you're referring to the second hand
second hand moves too quickly for that to work
for the smooth second hand, you'd need to consider the current milliseconds at each draw
 
tbh I used coordinates and just drew a line between the center and the end point
 
12:55 PM
so it would appear smooth and rotating, but really you're just drawing it at the appropriate position at every frame
you obviously can't do that using setInterval 1000
it would have to draw as fast as you could draw it
so requestAnimationFrame
 
I am having difficulty understanding the ngModel method of monitoring an input. The Angular room is 4 days old and lists no current people. I'm trying to monitor an input and determine validity. I know I have it tied to my variable, because I can see the changes reflected. I can use #spy to see its class state. But I'm having difficulty accessing it by name.
So, like with angular.io/guide/forms and their use of [hidden]="name.valid || name.pristine", I'm trying to be able to determine the validity of a number input.
<input matInput
           class="truncation-input"
           type="number"
           min="3"
           max="64"
           required
           [(ngModel)]="truncationCharMax"
           name="truncMax"
           #spy>
Valid: {{truncMax.valid}}
I get an error on compilation that "Property 'truncMax' does not exist" on my form. Which indeed, it is not a variable explicitly defined.
But, of course, truncationCharMax is not a form element and therefore cannot have "valid" checked on it.
Two decades in the industry doing embedded work and this web programming is kicking my ass...
The example code at angular.io just uses "name", but that's something that shows up as an id, as a name, and as a variable name within the class, and blast if I can tell which one it's referring to. Fiddling with the interactive StackBlitz instance isn't helping me figure it out. If I change enough variables, I get that error message to not show up, but it feels random. I don't see the pattern.
 
00:00 - 14:0014:00 - 00:00

« first day (3386 days earlier)      last day (1545 days later) »