Unavailable 501
Unavailable 501

Reputation: 3

Angular2 directive usage in template

I have found an recursive object view component that shows an object/array structure as a structured list. Here is the working component: https://embed.plnkr.co/Anxv8zImWmD0WzizCSVT/ What i tried was to use the directive in an template that is loaded via templateUrl instead using template. Here is my not working example: https://embed.plnkr.co/mHEKcxnUcTk85OSffbCe/

Can you tell me what did I do wrong in my example?

Thanks

Upvotes: 0

Views: 90

Answers (1)

BeetleJuice
BeetleJuice

Reputation: 40896

Your app won't start because it's unable to find your template file. In app.ts, change:

templateUrl: './my-template.html'

With:

templateUrl: 'src/my-template.html'

By the way, if you're just learning Angular, I strongly recommend that you work with the latest version. Your example is based on version 2 beta 15 and Angular has changed significantly since then, including many breaking changes.

Work with this plunkr instead. Angular team keeps it up to date with the latest version (currently 2 rc.5)

Upvotes: 1

Related Questions