Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/runkitdev/angular-runkit
Angular RunKit Component.
https://github.com/runkitdev/angular-runkit
Last synced: 29 days ago
JSON representation
Angular RunKit Component.
- Host: GitHub
- URL: https://github.com/runkitdev/angular-runkit
- Owner: runkitdev
- License: mit
- Created: 2017-06-05T21:43:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-10-10T20:46:32.000Z (about 1 year ago)
- Last Synced: 2024-11-29T21:45:34.026Z (about 1 month ago)
- Language: TypeScript
- Size: 10.7 KB
- Stars: 11
- Watchers: 9
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-runkit
Angular RunKit Component.
## Install
Install the package.
```sh
$ npm i -S angular-runkit
```Add the RunKit embed library to your index page:
**`src/index.html`**
```html...
...```
Whitelist `angular-runkit` in your System.js config:
**`src/systemjs.config.js`**
```js
map: {
...
'angular-runkit': 'npm:angular-runkit/dist/index.js',
...
}
```Declare the component in your module:
**`src/app/app.module.ts`**
```ts
import { RunKitEmbedComponent } from 'angular-runkit'...
@NgModule({
...
declarations: [
...
RunKitEmbedComponent,
...
],
...
})
```## Usage
```html
```
![](http://i.imgur.com/7mH8e6o.png)
Don't forget to check out the [RunKit embed docs](https://runkit.com/docs/embed#options).
## Inputs
### source : string
Specify the source code that the notebook will use.
```html
```
### readOnly : boolean
If `true`, the user will not be able to edit or run the embed.
```html
```
### mode : string
If `'endpoint'`, the notebook will be run as an endpoint and a link to the served page will be shown.
```html
```
### nodeVersion : string
Request a version or semver range for the node engine.
```html
```
### env : [string]
Provide a list of environment variables accessible in the notebook through process.env.
```html
```
### title : string
Provide a title for the notebook when opened on RunKit.
```html
```
### minHeight : string
Provide a minimum height for the embed (`'130px'` by default).
```html
```
### packageTimestamp : number
Specify the Unix time in milliseconds at which packages should resolved. Packages published after the date will be ignored.
```html
```
### preamble : string
Specify source code that is run before the main source. This code will not be shown in the embed.
```html
```
## Outputs
### onLoad : function
Provide a callback that is run when the embed is loaded.
```js
```
### onURLChanged : function
Provide a callback that is run whenever the embed's URL changes.
```js
```
### onEvaluate : function
Provide a callback that is run whenever the embed is evaluated.
```js
```
## Methods
### evaluate(callback : function) : void
Evaluate the notebook.
```html
Run
```