Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jrwebdev/db919d975125f11c1d4c455ba774951e to your computer and use it in GitHub Desktop.
Save jrwebdev/db919d975125f11c1d4c455ba774951e to your computer and use it in GitHub Desktop.
Angular 1 vs 2 Component Template URL
// Angular 1
const module = angular.module('myModule', []);
module.component('myComponent', {
templateUrl: 'path/to/my/template.html'
});
/***************************************************************/
// Angular 2
import {Component} from '@angular/core';
@Component({
selector: 'my-component',
templateUrl: 'path/to/my/template.html'
})
class MyComponent {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment