My code:
loadContract: async () => {
// Create a JavaScript version of the smart contract
const todoList = await $.getJSON('TodoList.json')
App.contracts.TodoList = TruffleContract(todoList)
App.contracts.TodoList.setProvider(App.web3Provider)
// Hydrate the smart contract with values from the blockchain
App.todoList = await App.contracts.TodoList.deployed()
},
Error its showing:
Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'TodoList')
My code: loadContract: async () => { // Create a JavaScript version of the smart contract const todoList = await $.getJSON('TodoList.json') App.contracts.TodoList = TruffleContract(todoList) App.contracts.TodoList.setProvider(App.web3Provider)
},
Error its showing: Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'TodoList')