I am using MVC .net core to populate my ViewModel. I am trying to build a chart and a canvas is not being created if the value is null. This is working fine.
regardless if I add a test in the script section to test for null
if (Model.AssessmentDetailByCategChart!= null)
{
or testing for element exists (and it should not )
if ($('#canvasRadarTech').length > 0) {
I have this crash. Could you please help with the proper syntax?
If I add a "@" in front of the model, then the rest of the code is not compiling.

use @if to test values in Model
@if (Model.AssessmentDetailByCategChart!= null)
{