rollthecloudinc / quell

Climate aware CMS breaking web apps free from carbon emissions.
https://demo.carbonfreed.app/pages/create-panel-page
GNU General Public License v3.0
14 stars 1 forks source link

Query Directives #276

Open ng-druid opened 2 years ago

ng-druid commented 2 years ago

Write queries directly inside angular templates.

<div *query="crud:s3_entity, { prefix: 'ads/' + adId  }; ad = entity">
  <h1>{{ ad.title }}</h1>
  <div>{{ ad.description }}</div>
</div>

Super charged *ngFor integrated directly with datasources.

<div *query="datasource_type:adaptor, options; ad = entity">
  <h1>{{ ad.title }}</h1>
  <div>{{ ad.description }}</div>
</div>

or

<div *query="datasource_type:adaptor?prefix=ads/{{ adId }}}; ad = entity">
  <h1>{{ ad.title }}</h1>
  <div>{{ ad.description }}</div>
</div>

or

implicit item context per iteration

<div *query="datasource_type:adaptor?prefix=ads/{{ adId }}}">
  <h1>{{ item.title }}</h1>
  <div>{{ item.description }}</div>
</div>

or

like a loop

<div *query="let ad in datasource_type:adaptor?prefix=ads/{{ adId }}}">
  <h1>{{ ad.title }}</h1>
  <div>{{ ad.description }}</div>
</div>