3settings 中文文档教程

发布于 3年前 浏览 23 更新于 3年前

Settings

此库是使用 Angular CLI 12.2.0 版生成的。

Code scaffolding

运行 ng generate component component-name --project settings 生成一个新组件。 您还可以使用 ng generate directive|pipe|service|class|guard|interface|enum|module --project settings

注意:不要忘记添加 --project settings 否则它将被添加到 angular.json 文件中的默认项目。

Build

运行 ng build settings 来构建项目。 构建工件将存储在 dist/ 目录中。

Publishing

使用 ng build settings 构建您的库后,转到 dist 文件夹 cd dist/settings 并运行 npm publish

Running unit tests

运行 ng test settings 以通过 Karma 执行单元测试。

Further help

要获得有关 Angular CLI 的更多帮助,请使用 ng help 或查看 Angular CLI 概述和命令参考 页面.

Implementation example

    export interface Option {
    id: string,
    name: string,
    checked: boolean
    }

    options: Option[] = [
        {
            id: "push_notifications",
            name: "Push notifications",
            checked: false
        },
        {
            id: "quick_access",
            name: "Quick access",
            checked: false
        }
    ]

    <emp-settings 
    (toggleCheckChanged)="onToggleChanged($event)" 
    [options]="options">
    </emp-settings>

Properties

PropertyDescriptionTypeDefault
idID to get the item from toggleCheckChanged.stringempty
nameSettings option name.stringDefault Label
checkedBoolean to indicate the toggle status.booleanfalse

Events

EventDescriptionType
toggleCheckChangedMethod to grab the toggle eventCustomEvent<{ id: string, checked: boolean }>

Settings

This library was generated with Angular CLI version 12.2.0.

Code scaffolding

Run ng generate component component-name --project settings to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project settings.

Note: Don't forget to add --project settings or else it will be added to the default project in your angular.json file.

Build

Run ng build settings to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build settings, go to the dist folder cd dist/settings and run npm publish.

Running unit tests

Run ng test settings to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.

Implementation example

    export interface Option {
    id: string,
    name: string,
    checked: boolean
    }

    options: Option[] = [
        {
            id: "push_notifications",
            name: "Push notifications",
            checked: false
        },
        {
            id: "quick_access",
            name: "Quick access",
            checked: false
        }
    ]

    <emp-settings 
    (toggleCheckChanged)="onToggleChanged($event)" 
    [options]="options">
    </emp-settings>

Properties

PropertyDescriptionTypeDefault
idID to get the item from toggleCheckChanged.stringempty
nameSettings option name.stringDefault Label
checkedBoolean to indicate the toggle status.booleanfalse

Events

EventDescriptionType
toggleCheckChangedMethod to grab the toggle eventCustomEvent<{ id: string, checked: boolean }>
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文