Skip to content

Commit

Permalink
Merge pull request #21 from bigBear713/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
bigBear713 authored Mar 11, 2023
2 parents cc14469 + ec57a18 commit 84f8d8b
Show file tree
Hide file tree
Showing 4 changed files with 316 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Angular common lib by bigBear713, include some common `component`, `directive`,
- [中文](https://github.com/bigBear713/nb-common/blob/master/CHANGELOG.CN.md "更新日志 - 中文")
- [English](https://github.com/bigBear713/nb-common/blob/master/CHANGELOG.md "Changelog - English")

## Readme
- [中文](https://github.com/bigBear713/nb-common/blob/master/README.CN.md "文档 - 中文")
- [English](https://github.com/bigBear713/nb-common/blob/master/README.md "Document - English")

## Feature
- 支持组件的更新策略为`ChangeDetectionStrategy.OnPush`;
- 支持在`standalone component`中使用;
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Angular common lib by bigBear713, include some common `component`, `directive`,
- [中文](https://github.com/bigBear713/nb-common/blob/master/CHANGELOG.CN.md "更新日志 - 中文")
- [English](https://github.com/bigBear713/nb-common/blob/master/CHANGELOG.md "Changelog - English")

## Readme
- [中文](https://github.com/bigBear713/nb-common/blob/master/README.CN.md "文档 - 中文")
- [English](https://github.com/bigBear713/nb-common/blob/master/README.md "Document - English")

## Feature
- Support the changeDetection of components as `ChangeDetectionStrategy.OnPush`;
- Support to be used in `standalone component`;
Expand Down
156 changes: 154 additions & 2 deletions projects/nb-common/README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ $ yarn add @bigbear713/nb-common

<br>

## API
### Module

#### NbCommonModule
Expand Down Expand Up @@ -134,6 +135,23 @@ this.valueType.isTemplateRef({}); // false
<!-- promiseDemo = Promise.resolve('1'); -->
<span [nb-r-str]="promiseDemo"></span>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbRStrComponent],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbRStrComponent],
// ...
})
export class XXXComponent{}
```

<br>

Expand Down Expand Up @@ -188,7 +206,23 @@ this.valueType.isTemplateRef({}); // false

<!-- 只想要加载失败时,显示默认图片(如果想显示其他图片,可设置errImg属性),不需要loading效果 -->
<img src="invalidImg" nbImg [errImg]="errImg">

```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbImgDirective],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbImgDirective],
// ...
})
export class XXXComponent{}
```

<br>
Expand All @@ -208,7 +242,23 @@ this.valueType.isTemplateRef({}); // false

<!-- placeholder$ = new BehaviorSubject('这是placeholder'); -->
<input [nbPlaceholder]="placeholder$">

```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbPlaceholderDirective],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbPlaceholderDirective],
// ...
})
export class XXXComponent{}
```

<br>
Expand Down Expand Up @@ -236,6 +286,23 @@ this.valueType.isTemplateRef({}); // false
<ng-container *ngSwitchDefault>{{content}}</ng-container>
</ng-container>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbIsAsyncPipe],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbIsAsyncPipe],
// ...
})
export class XXXComponent{}
```

<br>

Expand All @@ -260,6 +327,23 @@ this.valueType.isTemplateRef({}); // false
<ng-container *ngSwitchDefault>{{content}}</ng-container>
</ng-container>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbIsBooleanPipe],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbIsBooleanPipe],
// ...
})
export class XXXComponent{}
```

<br>

Expand All @@ -284,6 +368,23 @@ this.valueType.isTemplateRef({}); // false
<ng-container *ngSwitchDefault>{{+content+1}}</ng-container>
</ng-container>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbIsNumberPipe],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbIsNumberPipe],
// ...
})
export class XXXComponent{}
```

<br>

Expand All @@ -308,6 +409,23 @@ this.valueType.isTemplateRef({}); // false
<ng-container *ngSwitchDefault>{{content}}</ng-container>
</ng-container>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbIsObservablePipe],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbIsObservablePipe],
// ...
})
export class XXXComponent{}
```

<br>

Expand All @@ -332,6 +450,23 @@ this.valueType.isTemplateRef({}); // false
<ng-container *ngSwitchDefault>{{content}}</ng-container>
</ng-container>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbIsStringPipe],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbIsStringPipe],
// ...
})
export class XXXComponent{}
```

<br>

Expand All @@ -353,6 +488,23 @@ this.valueType.isTemplateRef({}); // false
```html
<ng-container [ngTemplateOutlet]="content | nbTplContent"></ng-container>
```
```ts
// v15.1.0新增
// 在NgModule中引入
@NgModule({
imports:[NbTplContentPipe],
// ...
})
export class XXXModule{}

// 在standalone component中引入
@Component({
standalone:true,
imports:[NbTplContentPipe],
// ...
})
export class XXXComponent{}
```

<br>

Expand Down
Loading

0 comments on commit 84f8d8b

Please sign in to comment.