• Stars
    star
    218
  • Rank 181,805 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

πŸ•΅οΈ An angular library that lets you inspect and change Angular component properties

inspector logo


MIT commitizen PRs styled with prettier All Contributors ngneat spectator

An angular library that lets you inspect and change Angular 9+ component properties

Inspector demo

Features

  • βœ… Inspect Angular 9+ components on the fly
  • βœ… Change component properties without touching the code
  • βœ… Simulate Angular events
  • βœ… See the results in realtime

Table of Contents

Installation

This library supports Angular 9+ projects and should only be installed using Angular CLI.

Angular CLI

ng add @ngneat/inspector

Above command will do following for you:

  1. Add and install following dev dependencies:
    1. @ngneat/inspector
    2. ace-builds
    3. tinykeys
  2. Import environments from ../environments/environment.ts in projects root module. This can be skipped with --skipImport.
  3. Import InspectorModule from @ngneat/inspector in your project's root module's imports section. This can be skipped with --skipImport.

πŸ‘‰ Please note: @ngneat/inspector is a debugging tool and it helps you to develop faster. So, it shouldn't be part of your production deployment. When you install it using ng add @ngneat/inspector it is already taken care for you, as it writes import statement like this: imports: [environment.production ? [] : InspectorModule.forRoot()]

Usage

  1. Click on Inspector button inspector button
  2. Then hover over the component which you want to inspect, you will see purple colored outline on the currently hovered element
    purple outline
  3. Click on the element and inspector will expand with component's details like name, selector, properties (with inputs), and outputs (if any)
    expanded inspector
  4. You can change the property/outputs from select
    select property
  5. Data types: Below are the supported data types and how it will render in inspector:
    1. String - input[type=text]
      string data type
    2. Number - input[type=text]
      number data type
    3. Boolean - input[type=checkbox]
      boolean data type
    4. Object - ace-editor
      object data type
  6. Properties - To update any property, after updating value, you will need to click on Update button to see the effect
    update button
  7. Outputs
    output
    1. To call the output, you will need to click on Emit button.
    2. By default, 1 argument with string type will be shown. You can change the type by change value from type select.
    3. You can also add/remove arguments by clicking on respective buttons

Options

When you ran ng add @ngneat/inspector, it added below statement in your imports array:

imports: [environment.production ? [] : InspectorModule.forRoot()]

Now, you can pass below config options to change inspector behavior in the .forRoot() method, like: InspectorModule.forRoot({ zIndex: 100000000 }).

All the options are optional.:

Option Type Description
enabled boolean Enable or disable the inspector
Default value: true
zIndex number Gives the CSS z-index to inspector host element. Useful in-case it's not visible by default.
Default value: 100000000
outline InspectorConfigOutline
{
Β Β Β Β color?: string;
Β Β Β Β width?: string;
Β Β Β Β style?: string;
}
Applies style to outline, when you're hovering over elements after starting inspector.
Default value:
{
Β Β Β Β color: '#ad1fe3',
Β Β Β Β width: '2px',
Β Β Β Β style: 'solid'
}
position InspectorConfigPosition
{
Β Β Β Β top?: string;
Β Β Β Β right?: string;
Β Β Β Β bottom?: string;
Β Β Β Β left?: string;
}
Applies CSS Style position co-ordinates to inspector host element. Please note inspector host element has position: fixed for better usability.
Default value:
{
Β Β Β Β top: '20px',
Β Β Β Β right: '20px'
}
keyCombo string Key combination pattern to start, stop and restart inspecting. Based on tinykeys keybinding syntax. You can disable this by setting enableKeyCombo to false.
Default value: Shift+I
closeOnEsc boolean Close/Stop inspector when escape key is pressed.
Default value: true
enableKeyCombo boolean Enable keyboard shortcut to open inspector. You can change the keybindings using keyCombo options.
Default value: true
hideNonSupportedProps boolean This hides non-supported types from selector. Only string, number, boolean and object are supported as of now.
Default value: true
filterProps RegExp A regular expression to filter out properties.
Default value: /(^__)\w*/g

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Dharmen Shah

πŸ’» πŸ–‹ πŸ€” 🚧

Netanel Basal

πŸ› πŸ–‹ πŸ“– πŸ€” πŸ§‘β€πŸ«

This project follows the all-contributors specification. Contributions of any kind welcome!


Icons made by Freepik from www.flaticon.com

More Repositories

1

falso

All the Fake Data for All Your Real Needs πŸ™‚
TypeScript
3,098
star
2

spectator

🦊 πŸš€ A Powerful Tool to Simplify Your Angular Tests
TypeScript
2,068
star
3

transloco

πŸš€ 😍 The internationalization (i18n) library for Angular
TypeScript
1,856
star
4

until-destroy

🦊 RxJS operator that unsubscribe from observables on destroy
TypeScript
1,733
star
5

elf

πŸ§™β€β™€οΈ A Reactive Store with Magical Powers
TypeScript
1,527
star
6

content-loader

βšͺ️ SVG component to create placeholder loading, like Facebook cards loading.
TypeScript
733
star
7

hot-toast

🍞 Smoking hot Notifications for Angular. Lightweight, customizable and beautiful by default.
TypeScript
687
star
8

cashew

🐿 A flexible and straightforward library that caches HTTP requests in Angular
TypeScript
677
star
9

reactive-forms

(Angular Reactive) Forms with Benefits πŸ˜‰
TypeScript
609
star
10

tailwind

πŸ”₯ A schematic that adds Tailwind CSS to Angular applications
TypeScript
608
star
11

query

πŸš€ Powerful asynchronous state management, server-state utilities and data fetching for Angular Applications
TypeScript
555
star
12

forms-manager

πŸ¦„ The Foundation for Proper Form Management in Angular
TypeScript
517
star
13

error-tailor

πŸ¦„ Making sure your tailor-made error solution is seamless!
TypeScript
478
star
14

helipopper

🚁 A Powerful Tooltip and Popover for Angular Applications
TypeScript
392
star
15

nx-serverless

πŸš€ The Ultimate Monorepo Starter for Node.js Serverless Applications
TypeScript
388
star
16

dialog

πŸ‘» A simple to use, highly customizable, and powerful modal for Angular Applications
TypeScript
371
star
17

hotkeys

πŸ€– A declarative library for handling hotkeys in Angular applications
TypeScript
325
star
18

edit-in-place

A flexible and unopinionated edit in place library for Angular applications
TypeScript
252
star
19

svg-icon

πŸ‘» A lightweight library that makes it easier to use SVG icons in your Angular Application
TypeScript
251
star
20

dirty-check-forms

🐬Detect Unsaved Changes in Angular Forms
TypeScript
199
star
21

input-mask

🎭 @ngneat/input-mask is an angular library that creates an input mask
TypeScript
199
star
22

lib

πŸ€– Lets you focus on the stuff that matters
TypeScript
180
star
23

transloco-keys-manager

πŸ¦„ The Key to a Better Translation Experience
TypeScript
174
star
24

dag

🐠 An Angular service for managing directed acyclic graphs
TypeScript
153
star
25

bind-query-params

Sync URL Query Params with Angular Form Controls
TypeScript
147
star
26

from-event

🦊 ViewChild and FromEvent β€” a Match Made in Angular Heaven
TypeScript
137
star
27

overview

πŸ€– A collection of tools to make your Angular views more modular, scalable, and maintainable
TypeScript
118
star
28

aim

Angular Inline Module Schematics
TypeScript
97
star
29

cmdk

Fast, composable, unstyled command menu for Angular. Directly inspired from pacocoursey/cmdk
TypeScript
91
star
30

copy-to-clipboard

βœ‚οΈ Modern copy to clipboard. No Flash.
TypeScript
78
star
31

variabless

JS & CSS - A Match Made in Heaven πŸ’Ž
HTML
78
star
32

loadoff

🀯 When it comes to loaders, take a load off your mind...
TypeScript
78
star
33

effects

πŸͺ„ A framework-agnostic RxJS effects implementation
TypeScript
63
star
34

avvvatars

Beautifully crafted unique avatar placeholder for your next angular project.
TypeScript
46
star
35

react-rxjs

πŸ”Œ "Plug and play" for Observables in React Apps!
TypeScript
37
star
36

subscribe

Subscription Handling Directive
TypeScript
34
star
37

elf-ng-router-store

Bindings to connect Angular router to Elf
TypeScript
24
star
38

ng-standalone-nx

TypeScript
24
star
39

lit-file-generator

🎁 A lit generator for a component, directive, and controller.
JavaScript
19
star
40

storage

TypeScript
18
star
41

material-schematics

TypeScript
3
star
42

svg-icon-demo

TypeScript
1
star