FIx ng-class initialization problem

Fixes issue #2009