Nathan Milota

Ranch Hand
+ Follow
since May 01, 2018
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nathan Milota

It took me awhile, but this finally fixed it.  

I had to do an ngModel for the varaibles itemName and itemDescription, put them into local Storage, retrieve them in the onSubmit() method so they wouldn't be null, and now it works.
I've tried this several different ways.   I even put an input as a typescript variable and pass it in the loop, but it always becomes null when I try to use it.  It doesn't do this in Java.  There is something wrong with the way this language works I think.
The item object keeps going to null and I cannot use it in a loop or where I need to.  

When I log the item to the console the second time, it goes to null.   How do I stop that from happening?
This is actually a problem with the back end, but I'm still not sure what is causing it, but it's not an angular problem.
 I have a Bin class, and when I post warehouseNum to it, when I do the console.log(this.bin) it is showing the correct warehouseNum, but when you console.log(data) it shows it as 0.   Why does it do that?

Okay, so for some reason, I concluded that the objects are not coming up as equal when they are on the two different lists.   I changed the code to...

This is more of a workaround than an ideal situation though.

An object of type Bin contains an Array of type Item.  

It is supposed to print true as I am searching for an item the bin items list contains, but it keeps returning false.  

There has to be some error in the logic of the loops, but I can't find it.   No matter what items I put in the list where the bins contain those items, it keeps printing false.
It's saying active and direction are missing, but they are both in the function.   I don't get what's going on.
I have an HTML code which includes this...

My function in typescript is this...

It's giving me the following error.  

 Error: src/app/components/edit-delete-item/edit-delete-item.component.html:4:51 - error TS2345: Argument of type 'Event' is not assignable to parameter of type 'Sort'.
     Type 'Event' is missing the following properties from type 'Sort': active, direction

   4         <table matSort (matSortChange)= "sortData($event)">

It's the exact same code as I used in another program that worked just fine, and I don't get why it's not working.   I have reviewed the code that is working, and made sure it matched this exactly other than the object names, and it's not working here.

Why am I getting this error?

I don't understand what that means.   Do you have an example?
1 month ago
I just don't get it, if the OneToMany relationship always behaves this way, why would anyone ever use it?
1 month ago
What are you saying?   Ditch the entire OneToMany and ManyToOne relationship, and just give a company number to a user?
1 month ago
The User class has a ManyToOne and the Company class has a OneToMany.   I showed the classes in my other thread related to Angular and Typescript that's causing an undefined error.
1 month ago