Question: what is the difference between template and templateurl in angular 2?
Answer: 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.