I'm not sure whats wrong with my if statement. I'm trying to use my model inside my javascript.
if (@Model !== null)
{
if (@Model.Level !== null)
{
//use @Model.Level
}
}
else
{
//use default
}
The Model is null, but it still steps into the first if statement (and breaks on the second one obviously). I've tried @Model
, !@Model
and !=
but it still always steps in.
What am I doing wrong? (It's also got squiggly red lines under both !==
saying there is a syntax error)