Angular(build打包)報錯:supplied parameters do not match any signature of call target

在寫Angular時,npm run build 報錯了:supplied parameters do not match any signature of call target。

然後去搜索了一下,Stack Overflow上有一篇Supplied parameters do not match any signature of call target in wrapper method - Typescript,,大概知道是方法參數無匹配或者對應出錯,然後又看了其他的,確實是參數對應錯誤.

於是我去全檢查了一遍,找到了問題,是因爲日期組件的方法,有3處地方用到,,要寫6遍,有個參數漏傳了,,在HTML裏,,之前沒發現,好氣,寫代碼一定要仔細規範!!!要不然找問題找的頭禿。。。

ts文件:

HTML文件:

在寫ts的時候,,參數如果是必傳,就一定要寫上對應參數,如果想不寫就設置參數不必傳:

 

參考文章:

angularjs build時報錯 Supplied parameters do not match any signature of call target

https://stackoverflow.com/questions/25631801/supplied-parameters-do-not-match-any-signature-of-call-target-in-wrapper-method

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章