Skip to content

Commit c7a286e

Browse files
committed
Add demo angular and Ionic 2+
1 parent 3945151 commit c7a286e

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ This will install the current stable version of `database-builder` in your `node
1414

1515
### Step 2: Usage Typescript
1616

17-
[In StackBlitz](https://stackblitz.com/edit/typescript-cfzt6q)
17+
[*Demo*](https://stackblitz.com/edit/typescript-cfzt6q)
1818

1919
```ts
2020
import { Query } from 'database-builder';
2121
import { TestClazz, TestClazzRef } from './models';
2222

2323
let querySimple = new Query(TestClazz);
24-
print(querySimple.compile());
24+
console.log(querySimple.compile());
2525
/**
2626
* {
2727
* params: [],
@@ -34,7 +34,7 @@ queryWhere.where(where => {
3434
where.contains(x => x.description, "abc");
3535
where.greatValue(x => x.id, 1);
3636
});
37-
print(queryWhere.compile());
37+
console.log(queryWhere.compile());
3838
/**
3939
* {
4040
* params: ["%abc%", 1],
@@ -49,7 +49,7 @@ queryProjections.projection(projection => {
4949
projection.max(x => x.referenceTest.id);
5050
projection.count(x => x.id, "countId");
5151
});
52-
print(queryProjections.compile());
52+
console.log(queryProjections.compile());
5353
/**
5454
* {
5555
* params: [],
@@ -59,7 +59,7 @@ print(queryProjections.compile());
5959

6060
const queryOrderBy = new Query(TestClazz);
6161
queryOrderBy.orderBy(x => x.id);
62-
print(queryOrderBy.compile());
62+
console.log(queryOrderBy.compile());
6363
/**
6464
* {
6565
* params: [],
@@ -71,7 +71,7 @@ const queryGroupBy = new Query(TestClazz);
7171
queryGroupBy.groupBy(x => x.id, (having, projection) => {
7272
having.greatValue(projection.count(x => x.id), 10);
7373
});
74-
print(queryGroupBy.compile());
74+
console.log(queryGroupBy.compile());
7575
/**
7676
* {
7777
* params: [10],
@@ -80,8 +80,8 @@ print(queryGroupBy.compile());
8080
*/
8181

8282
const queryLimitOffset = new Query(TestClazz);
83-
queryLimitOffset.limit(10/*, 5*/);
84-
print(queryLimitOffset.compile());
83+
queryLimitOffset.limit(10, 5);
84+
console.log(queryLimitOffset.compile());
8585
/**
8686
* {
8787
* params: [10, 5],
@@ -109,6 +109,8 @@ export class TestClazzRef{
109109

110110
### Usage Angular 2+
111111

112+
[*Demo*](https://stackblitz.com/edit/angular-vxnvua)
113+
112114
```ts
113115
import { Component } from '@angular/core';
114116
import { Query } from 'database-builder';
@@ -133,4 +135,8 @@ export class AppComponent {
133135
*/
134136
}
135137
}
136-
```
138+
```
139+
140+
### Usage Ionic 2+
141+
142+
[*Demo*](https://stackblitz.com/edit/ionic-6sdjng)

0 commit comments

Comments
 (0)