Apologies in advance for my lack of clarity in expressing this question, which is why I am seeking assistance rather than finding the solution on my own.
My query pertains to loading a component within another one and specifying it in the directive. Below is a brief example I created from scratch as I am struggling with the correct syntax:
http://plnkr.co/edit/gFsqGJmmayOsewL3EfLf
import {Component} from 'angular2/core'
import {Prueba} from './prueba'
@Component({
selector: 'my-app',
providers: [],
template: `
<div>
<h2>Hello {{name}}</h2>
<prueba></prueba>
</div>
`,
directives: [Prueba]
})
export class App {
constructor() {
this.name = 'Angular2'
}
}
In the app.ts file, you'll notice there is a directive inside the component, without which the code fails to work properly. Although I am not entirely sure why, this is how I have been taught.
My objective now is to implement multiple components, such as Prueba along with an additional one that includes extra content (initially just another "phrase," but eventually akin to http://plnkr.co/edit/SVPNwk?p=preview). Unfortunately, no matter what I attempt, I experience issues with the syntax, causing even this basic example to fail.
I admit to being confused about what key concepts I might be overlooking. Despite importing and using the new component's selector, the application consistently encounters errors. What fundamental understanding eludes me?
If my explanation remains inadequate, I am referring to the theoretical concept outlined here:
angular.io/docs/ts/latest/cheatsheet.html (I cannot post more than two links... anyway its the @Component part, that's the documentation I'm consulting).