Hello,
I would like to build a list component that e.g. has a pagination, detail 
and short view. The bussiness logic with pagination and switching between 
detail or short view should be encapsulated inside of an angular2 
component. How the single entries look like should be defined from the 
outside.

Plunker: http://plnkr.co/edit/SfKNVa2nXAavJupEfnjA

The outside:

      <my-person>
        <div person-details>
          This only appears in the first entry, but should be displayed in 
every entry..
          <!-- I would like to do the following

          <p>ID: {{person.id}}</p>
          <p>{{person.lastname}}, {{person.name}}</p>
          <button (click)="sayHello(person.name)">Say Hello</button>

          -->
        </div>
      </my-person>

The inside template of my-person:

    <div *ng-for="#person of people">
      <h3>Person - {{person.name}}</h3>
      <ng-content select="[person-details]"></ng-content>
      <hr />
    </div>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to