-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
206 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/survey-creator-angular/example/angular-ui/src/app/app.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<svc-creator></svc-creator> | ||
<svc-creator [model]="creator"></svc-creator> |
73 changes: 73 additions & 0 deletions
73
packages/survey-creator-angular/example/angular-ui/src/app/app.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,82 @@ | ||
import { Component } from "@angular/core"; | ||
import { SurveyModel } from "survey-core"; | ||
import { CreatorBase } from "survey-creator-core"; | ||
|
||
@Component({ | ||
selector: "app-root", | ||
templateUrl: "./app.component.html" | ||
}) | ||
export class AppComponent { | ||
public isTest = !!(<any>window)["%hammerhead%"]; | ||
public survey = new SurveyModel({ | ||
"logoPosition": "right", | ||
"completedHtml": "<h3>Thank you for your feedback.</h3><h5>Your thoughts and ideas will help us to create a great product!</h5>", | ||
"completedHtmlOnCondition": [ | ||
{ | ||
"expression": "{nps_score} > 8", | ||
"html": "<h3>Thank you for your feedback.</h3><h5>We glad that you love our product. Your ideas and suggestions will help us to make our product even better!</h5>" | ||
}, | ||
{ | ||
"expression": "{nps_score} < 7", | ||
"html": "<h3>Thank you for your feedback.</h3><h5> We are glad that you share with us your ideas.We highly value all suggestions from our customers. We do our best to improve the product and reach your expectation.</h5><br />" | ||
} | ||
], | ||
"pages": [ | ||
{ | ||
"name": "page1", | ||
"elements": [ | ||
{ | ||
"type": "rating", | ||
"name": "nps_score", | ||
"title": "On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?", | ||
"isRequired": true, | ||
"rateMin": 0, | ||
"rateMax": 10, | ||
"minRateDescription": "(Most unlikely)", | ||
"maxRateDescription": "(Most likely)" | ||
}, | ||
{ | ||
"type": "checkbox", | ||
"name": "promoter_features", | ||
"visible": false, | ||
"visibleIf": "{nps_score} >= 9", | ||
"title": "Which features do you value the most?", | ||
"isRequired": true, | ||
"validators": [ | ||
{ | ||
"type": "answercount", | ||
"text": "Please select two features maximum.", | ||
"maxCount": 2 | ||
} | ||
], | ||
"choices": [ | ||
"Performance", | ||
"Stability", | ||
"User Interface", | ||
"Complete Functionality" | ||
], | ||
"hasOther": true, | ||
"otherText": "Other feature:", | ||
"colCount": 2 | ||
}, | ||
{ | ||
"type": "comment", | ||
"name": "passive_experience", | ||
"visible": false, | ||
"visibleIf": "{nps_score} > 6 and {nps_score} < 9", | ||
"title": "What do you like about our product?" | ||
}, | ||
{ | ||
"type": "comment", | ||
"name": "disappointed_experience", | ||
"visible": false, | ||
"visibleIf": "{nps_score} notempty", | ||
"title": "What do you miss or find disappointing in your experience with our products?" | ||
} | ||
] | ||
} | ||
], | ||
"showQuestionNumbers": "off" | ||
}); | ||
public creator = new CreatorBase({}, {}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<div> | ||
Creator ! | ||
<survey [model]="survey"></survey> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,88 @@ | ||
import { Component } from "@angular/core"; | ||
import { Component, Input } from "@angular/core"; | ||
import { SurveyModel } from "survey-core"; | ||
import { BaseAngular } from "survey-angular-ui"; | ||
import { CreatorBase } from "survey-creator-core"; | ||
|
||
@Component({ | ||
selector: "svc-creator", | ||
templateUrl: "./creator.component.html", | ||
styleUrls: [] | ||
}) | ||
export class CreatorComponent { | ||
export class CreatorComponent extends BaseAngular<CreatorBase> { | ||
@Input() model!: CreatorBase; | ||
|
||
protected getModel(): CreatorBase { | ||
return this.model; | ||
} | ||
|
||
public survey = new SurveyModel({ | ||
"logoPosition": "right", | ||
"completedHtml": "<h3>Thank you for your feedback.</h3><h5>Your thoughts and ideas will help us to create a great product!</h5>", | ||
"completedHtmlOnCondition": [ | ||
{ | ||
"expression": "{nps_score} > 8", | ||
"html": "<h3>Thank you for your feedback.</h3><h5>We glad that you love our product. Your ideas and suggestions will help us to make our product even better!</h5>" | ||
}, | ||
{ | ||
"expression": "{nps_score} < 7", | ||
"html": "<h3>Thank you for your feedback.</h3><h5> We are glad that you share with us your ideas.We highly value all suggestions from our customers. We do our best to improve the product and reach your expectation.</h5><br />" | ||
} | ||
], | ||
"pages": [ | ||
{ | ||
"name": "page1", | ||
"elements": [ | ||
{ | ||
"type": "rating", | ||
"name": "nps_score", | ||
"title": "On a scale of zero to ten, how likely are you to recommend our product to a friend or colleague?", | ||
"isRequired": true, | ||
"rateMin": 0, | ||
"rateMax": 10, | ||
"minRateDescription": "(Most unlikely)", | ||
"maxRateDescription": "(Most likely)" | ||
}, | ||
{ | ||
"type": "checkbox", | ||
"name": "promoter_features", | ||
"visible": false, | ||
"visibleIf": "{nps_score} >= 9", | ||
"title": "Which features do you value the most?", | ||
"isRequired": true, | ||
"validators": [ | ||
{ | ||
"type": "answercount", | ||
"text": "Please select two features maximum.", | ||
"maxCount": 2 | ||
} | ||
], | ||
"choices": [ | ||
"Performance", | ||
"Stability", | ||
"User Interface", | ||
"Complete Functionality" | ||
], | ||
"hasOther": true, | ||
"otherText": "Other feature:", | ||
"colCount": 2 | ||
}, | ||
{ | ||
"type": "comment", | ||
"name": "passive_experience", | ||
"visible": false, | ||
"visibleIf": "{nps_score} > 6 and {nps_score} < 9", | ||
"title": "What do you like about our product?" | ||
}, | ||
{ | ||
"type": "comment", | ||
"name": "disappointed_experience", | ||
"visible": false, | ||
"visibleIf": "{nps_score} notempty", | ||
"title": "What do you miss or find disappointing in your experience with our products?" | ||
} | ||
] | ||
} | ||
], | ||
"showQuestionNumbers": "off" | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters