service angular 2 code example Example 1: angular new service ng g s serviceName Example 2: add service in angular ng generate service service_name