• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Mat-Sort Table not working. Argument of type 'Event' is not assignable to parameter of type 'Sort'

 
Ranch Hand
Posts: 442
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Nathan Milota
Ranch Hand
Posts: 442
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's saying active and direction are missing, but they are both in the function.   I don't get what's going on.
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic