what are differences between template and templateurl?
You can pass a string literal to template consisting of your components HTML. This way you have the HTML source in the same file as the TypeScript code. With templateUrl you're referencing an external file containing the template HTML. This way you have HTML and TypeScript in separate files.