RE: [coldbox:7003] Re: Completely stumped on DI and cfproperty

Don’t forget you can also modify LogBox to log debug level messages from coldbox.system and you will get a wealth of information on what wirebox is doing. Honestly, this should be the first thing you do when you have troubles. Otherwise you’re just flying in the dark.

Also, do you have autowire=“true” om the cfcomponent tag that you are expecting to have dependencies injected into?

And, like Andrew said, init() is called prior to DI, onDIComplete() is called after.



Hi all,

Ok, this is solved!

What I wasn't getting was that DI happens *after* the init() function,
and that was messing up the order of some things that I had.

So, I was actually able to use cfproperty (which seems cleaner to me)
but I removed all references to that injected model to a function
outside of init() and then called that function from within init() in
order to populate my object.

All is working well now.

Thanks everyone for taking the time to help out. It is very much