Skip to content

Commit

Permalink
updated survey-library docs [azurepipelines skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov committed Jul 10, 2024
1 parent cc63c4e commit 5a97932
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/get-started-angular.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ SurveyJS Form Library is shipped with several predefined themes illustrated belo
To add SurveyJS themes to your Angular application, open the `angular.json` file and reference the Form Library style sheet:
```js
// angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
// ...
Expand All @@ -77,6 +78,13 @@ To add SurveyJS themes to your Angular application, open the `angular.json` file
}
```
When [using standalone components](https://github.com/surveyjs/code-examples/tree/main/get-started-library/angular-standalone-components), import the style sheet directly in the component file:

```js
// survey.component.ts
import "survey-core/defaultV2.css";
```

This style sheet applies the Default theme. If you want to apply a different predefined theme or create a custom theme, refer to the following help topic for detailed instructions: [Themes & Styles](https://surveyjs.io/form-library/documentation/manage-default-themes-and-styles).

> Previous to v1.9.100, SurveyJS also supplied the Modern theme, which is now obsolete. Please migrate to one of the predefined themes or create a custom theme.
Expand Down Expand Up @@ -158,7 +166,7 @@ export class AppComponent implements OnInit {

## Render the Form

Before you render the survey, you need to import the module that integrates the SurveyJS Form Library with Angular. Open your NgModule class (usually resides in the `app.module.ts` file), import the `SurveyModule` from `survey-angular-ui`, and list it in the `imports` array.
Before you render the survey, you need to import the module that integrates the SurveyJS Form Library with Angular. Open your `NgModule` class (usually resides in the `app.module.ts` file), import the `SurveyModule` from `survey-angular-ui`, and list it in the `imports` array.

```js
// app.module.ts
Expand All @@ -175,7 +183,24 @@ import { SurveyModule } from "survey-angular-ui";
bootstrap: [ ... ]
})
export class AppModule { }
```

When [using standalone components](https://github.com/surveyjs/code-examples/tree/main/get-started-library/angular-standalone-components), import the `SurveyModule` and add it to the `imports` array directly in the component file:

```js
// survey.component.ts
// ...
import { SurveyModule } from 'survey-angular-ui';

@Component({
// ...
standalone: true,
imports: [ SurveyModule ],
// ...
})
export class SurveyComponent implements OnInit {
// ...
}
```

To render a survey, add a `<survey>` element to your component template and bind the element's `model` attribute to the model instance you created in the previous step:
Expand Down

0 comments on commit 5a97932

Please sign in to comment.