
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
questionnaire-webcomponent
Advanced tools
The **Questionnaire Player** is a web component built with Angular (version 16.2.1).
The Questionnaire Player is a web component built with Angular (version 16.2.1).
npm install
after cloning the repo locally to install the necessary dependencies.npm run build-web-comp
to build the player with the latest changes and reflect the updates in the web component.projects/questionnaire-app
and run ng serve
for a dev server. Open http://localhost:4200/ in your browser. The application will automatically reload when source files are changed.
npm run build-web-comp
will automatically reflect those changes in the demo app (applicable only to this Angular app, not the React demo app).The web component can be installed by running:
npm i questionnaire-webcomponent
In angular.json, include the published web component script under the "scripts" section (navigate to projects -> questionnaire-app -> architect -> build).
Path to the web component script:
"scripts":[... , "node_modules/questionnaire-webcomponent/questionnaire-player-webcomponent.js"]
To include the npm-published styles of the web component, add the following path to the "styles" section in angular.json:
"styles":[... , "node_modules/questionnaire-webcomponent/styles.scss"]
For usage in a React app, visit the React demo repository - https://github.com/5Amogh/react-usingwebcomponent-app
API-based Data Fetching
apiConfig
object.Configurable Theming
Pagination
Question Map (Navigation)
To integrate the web component into your Angular application, include the following in your HTML file:
<questionnaire-player-main angular [apiConfig]="apiConfig"></questionnaire-player-main>
If you are using the webcomponent inside an angular application, use the attribute angular in questionnaire-player-main tag to help the webcomponent detect the input changes inside ngOnChanges
In your Angular component, you can configure the apiConfig object as follows:
apiConfig = {
baseURL: '<base_url>',
fileSizeLimit:<fileSizeInNumber(MB)>,
userAuthToken: '<user_auth_token>',
solutionId: '<solution_id>',
solutionType: 'survey' | 'observation'
}
baseURL: Base url is necessary for making API requests to fetch, save, submit the questionnaire data fileSizeLimit: To limit the size of the file uploads for evidences, in MB. userAuthToken: Necessary to append during API requests for authentication. solutionId: Necessary to render and make changes to a survey or an observation via API requests. solutionType: To switch the endpoints for API requests and features as applicable to survey and observation.
To apply custom theming in your application, you can define CSS variables in your global styles (e.g., :root
):
:root {
--primary-color: 1B4CA1;
--btn-outline: 1B4CA1;
--error-color: rgb(150, 4, 4);
--question-tip: gray;
--general-btn-text-color: white;
--general-btn-hover-bg: white;
--secondary-btn-bg: white;
--secondary-btn-hover-bg: whitesmoke;
--card-bg: white;
--disabled-btn-bg: gainsboro;
--disabled-btn-text: gray;
}
This allows you to control the visual appearance of the web component and ensure it aligns with your application's design.
FAQs
The **Questionnaire Player** is a web component built with Angular (version 16.2.1).
The npm package questionnaire-webcomponent receives a total of 142 weekly downloads. As such, questionnaire-webcomponent popularity was classified as not popular.
We found that questionnaire-webcomponent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.