object is possibly 'undefined' inside if block code example Example: angular error TS2532: Object is possibly 'undefined'. npm install typescript@beta