Skip to content

Commit 8fd1c40

Browse files
committed
hello world
1 parent c0f0a38 commit 8fd1c40

File tree

9 files changed

+121
-23
lines changed

9 files changed

+121
-23
lines changed

examples/demo/README.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11

2-
[Open fullscreen](/demo/) | [Source on github](https://github.com/activewidgets/react/tree/master/examples/demo) | [Edit on Codesandbox](https://codesandbox.io/s/github/activewidgets/react/tree/master/examples/demo)
2+
[Open fullscreen](https://angular.activewidgets.com/demo/) | [Source on github](https://github.com/activewidgets/angular/tree/master/examples/demo) | [Edit on Codesandbox](https://codesandbox.io/s/github/activewidgets/angular/tree/master/examples/demo)
33

4-
5-
A minimal example showing ActiveWidgets datagrid for React
6-
7-
```js
8-
import React from "react";
9-
import ReactDOM from "react-dom";
10-
import {Datagrid} from "@activewidgets/react";
11-
import {columns, rows} from "./data.js"
12-
import "./styles.css";
13-
14-
function App() {
15-
return (
16-
<Datagrid columns={columns} rows={rows} />
17-
);
18-
}
19-
20-
const rootElement = document.getElementById("root");
21-
ReactDOM.render(<App />, rootElement);
22-
```
23-
24-
[![Edit react-get-started](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/activewidgets/react/tree/master/examples/get-started)
4+
Angular demo

examples/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"description": "Demo - ActiveWidgets/Angular",
55
"keywords": [],
6-
"main": "src/index.js",
6+
"main": "src/main.js",
77
"scripts": {
88
"start": "parcel index.html --open",
99
"build": "parcel build index.html"

examples/hello-world/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
[Open fullscreen](https://angular.activewidgets.com/hello-world/) | [Source on github](https://github.com/activewidgets/angular/tree/master/examples/hello-world) | [Edit on Codesandbox](https://codesandbox.io/s/github/activewidgets/angular/tree/master/examples/hello-world)
3+
4+
Angular example

examples/hello-world/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>Hello World - ActiveWidgets/Angular</title>
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="src/main.js"></script>
10+
</body>
11+
</html>

examples/hello-world/package.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "angular-hello-world",
3+
"version": "1.0.0",
4+
"description": "Hello World - ActiveWidgets/Angular",
5+
"keywords": [],
6+
"main": "src/main.js",
7+
"scripts": {
8+
"start": "parcel index.html --open",
9+
"build": "parcel build index.html"
10+
},
11+
"dependencies": {
12+
"@activewidgets/angular": "0.0.10",
13+
"@angular/core": "^8",
14+
"@angular/common": "^8",
15+
"@angular/compiler": "^8",
16+
"@angular/compiler-cli": "^8",
17+
"@angular/platform-browser": "^8",
18+
"@angular/platform-browser-dynamic": "^8",
19+
"rxjs": "^6",
20+
"typescript": ">=3.4 <3.6",
21+
"zone.js": "~0.9.1"
22+
},
23+
"devDependencies": {
24+
"parcel-bundler": "^1"
25+
},
26+
"private": true
27+
}

examples/hello-world/src/app.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
import { Component } from '@angular/core';
3+
import './styles.css';
4+
5+
6+
const template = `<ax-datagrid [rows]="rows"></ax-datagrid>`;
7+
8+
9+
export class App {
10+
11+
constructor(){
12+
this.rows = [
13+
{ message: 'Hello, World!' }
14+
];
15+
}
16+
17+
18+
static get annotations() { return [new Component({
19+
selector: '#app',
20+
template
21+
})]}
22+
}

examples/hello-world/src/main.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
import 'core-js/es7/reflect';
3+
import 'zone.js/dist/zone';
4+
5+
import { NgModule, enableProdMode } from '@angular/core';
6+
import { BrowserModule } from '@angular/platform-browser';
7+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
8+
import { AxModule } from '@activewidgets/angular';
9+
10+
import '@activewidgets/angular/css';
11+
12+
import { App } from './app.js';
13+
14+
15+
enableProdMode();
16+
17+
18+
class Module {
19+
static get annotations() { return [new NgModule({
20+
imports: [BrowserModule, AxModule],
21+
declarations: [App],
22+
bootstrap: [App]
23+
})]}
24+
}
25+
26+
platformBrowserDynamic().bootstrapModule(Module);
27+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
body {
3+
margin: 60px;
4+
font: 14px/1.2143 'Segoe UI', 'Avenir', 'Helvetica Neue', 'Tahoma', sans-serif;
5+
}
6+
7+
.ax-datagrid {
8+
max-height: 80px;
9+
}
10+
11+
.ax-headers-view {
12+
font-weight: bold;
13+
color: #666;
14+
border-bottom: 1px solid #aaa;
15+
}
16+
17+
.ax-gridlines {
18+
border-bottom: 1px solid #eee;
19+
}

examples/viewer/examples.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11

2+
import hello_world from '../hello-world/README.md';
3+
4+
5+
export const Local = {
6+
'Hello, World!': {path: 'hello-world', readme: hello_world}
7+
};
8+
9+
210
export * from '@activewidgets/datagrid/examples';
311

0 commit comments

Comments
 (0)