• Stars
    star
    218
  • Rank 175,582 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 4 years ago
  • Updated over 1 year 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,029
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,712
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
671
star
9

reactive-forms

(Angular Reactive) Forms with Benefits ๐Ÿ˜‰
TypeScript
610
star
10

tailwind

๐Ÿ”ฅ A schematic that adds Tailwind CSS to Angular applications
TypeScript
608
star
11

forms-manager

๐Ÿฆ„ The Foundation for Proper Form Management in Angular
TypeScript
517
star
12

query

๐Ÿš€ Powerful asynchronous state management, server-state utilities and data fetching for Angular Applications
TypeScript
510
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
104
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
59
star
34

avvvatars

Beautifully crafted unique avatar placeholder for your next angular project.
TypeScript
42
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