ngStyle: accept object with key-value pair, key is CSS property name, such as backgroudColor; value is CSS property value, and if this value is string, you have to use single quotation marker (this is not as normal CSS syntax, because Angular will treat content in double quotation marker as angular syntax), so for value part, you also can use calling a method to return a property value. such as: [ngStyle] = “{backgroundColor: ‘red’}” or [ngStyle] = “{backgroundColor: getPropertyValue()}”
ngClass: accept object with key-value pair, key is class name; and value is boolean value, true will attach this class, but false will not attach this class