Skip to content

Commit 1ffa792

Browse files
committed
Updated readme and updated compilation scripts
1 parent 00b386f commit 1ffa792

File tree

6 files changed

+75
-75
lines changed

6 files changed

+75
-75
lines changed

README.md

Lines changed: 27 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,39 @@ Semantic UI Angular 2 Integrations, written in pure AngularJS - **no JQuery requ
99
## Installation
1010

1111
To install this library, run:
12-
1312
```bash
1413
$ npm install ng2-semantic-ui --save
1514
```
1615

17-
Add a reference to your `index.html` file: (also ensure you have a reference to the Semantic UI CSS file)
18-
16+
Next include the Semantic UI CSS file in your `index.html` (you can include a manually compiled one if you use themes):
1917
```html
20-
<script src="node_modules/ng2-semantic-ui/bundles/ng2-semantic-ui.min.js"></script>
18+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.2.4/semantic.min.css">
2119
```
2220

23-
Start using the directives:
21+
Once installed you need to import the main module:
22+
```ts
23+
import {SuiModule} from 'ng2-semantic-ui';
24+
```
2425

26+
Finally import the main module into your application module:
2527
```ts
26-
import {DIRECTIVES} from `ng2-semantic-ui/ng2-semantic-ui';
28+
import {SuiModule} from 'ng2-semantic-ui';
29+
30+
@NgModule({
31+
declarations: [AppComponent, ...],
32+
imports: [SuiModule, ...],
33+
bootstrap: [AppComponent]
34+
})
35+
export class AppModule {}
2736
```
2837

38+
Now you're good to go!
39+
40+
## Dependencies
41+
42+
* [Angular 2](https://angular.io) (2.0.0-rc.5)
43+
* [Semantic UI CSS](http://semantic-ui.com/) (jQuery is **not** required)
44+
2945
## Components
3046

3147
The current list of available components with links to their docs is below:
@@ -39,54 +55,21 @@ The current list of available components with links to their docs is below:
3955
* [Progress](http://edcarroll.github.io/ng2-semantic-ui/#/components/progress)
4056
* [Rating](http://edcarroll.github.io/ng2-semantic-ui/#/components/rating)
4157
* [Search](http://edcarroll.github.io/ng2-semantic-ui/#/components/search)
58+
* [Select](http://edcarroll.github.io/ng2-semantic-ui/#/components/select)
4259
* [Tab](http://edcarroll.github.io/ng2-semantic-ui/#/components/tab)
4360

44-
## Quick start (from scratch)
45-
46-
Clone the [angular2-quickstart](https://github.com/valor-software/angular2-quickstart) repository, and set everything up.
47-
48-
Add the following lines to your `index.html`:
49-
```html
50-
<script src="node_modules/ng2-semantic-ui/bundles/ng2-semantic-ui.min.js"></script>
51-
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.css">
52-
```
53-
54-
Update your `app.component.ts` to be the following:
55-
56-
```ts
57-
import {Component} from 'angular2/core';
58-
import {CHECKBOX_DIRECTIVES} from 'ng2-semantic-ui/ng2-semantic-ui';
59-
60-
@Component({
61-
selector: 'my-app',
62-
directives: [CHECKBOX_DIRECTIVES],
63-
template: `
64-
<sui-checkbox>Checkbox example</sui-checkbox>
65-
`
66-
})
67-
export class AppComponent {}
68-
```
69-
70-
And you're good to go!
71-
7261
## Development
7362

7463
To generate all library `*.js`, `*.js.map` and `*.d.ts` files:
7564

7665
```bash
77-
$ npm run tsc
78-
```
79-
80-
To run the demo app:
81-
```bash
82-
$ npm run demo
66+
$ npm run compile
67+
# use compile:w to watch for changes
8368
```
8469

85-
To compile the demo app without running it:
86-
70+
To run the demo app (you must have [Angular-CLI](https://github.com/angular/angular-cli) installed):
8771
```bash
88-
$ npm run tsc-demo
89-
# use tsc-demo:w to watch for changes
72+
$ ng serve
9073
```
9174

9275
## License

demo/app/app.component.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
<div class="item">
1818
<div class="active header">Components</div>
1919
<div class="menu">
20-
<a class="item" routerLink="/accordion" routerLinkActive="active">Accordion</a>
21-
<a class="item" routerLink="/checkbox" routerLinkActive="active">Checkbox</a>
22-
<a class="item" routerLink="/collapse" routerLinkActive="active">Collapse</a>
23-
<a class="item" routerLink="/dimmer" routerLinkActive="active">Dimmer</a>
24-
<a class="item" routerLink="/dropdown" routerLinkActive="active">Dropdown</a>
25-
<a class="item" routerLink="/message" routerLinkActive="active">Message</a>
26-
<a class="item" routerLink="/progress" routerLinkActive="active">Progress</a>
27-
<a class="item" routerLink="/rating" routerLinkActive="active">Rating</a>
28-
<a class="item" routerLink="/search" routerLinkActive="active">Search</a>
29-
<a class="item" routerLink="/select" routerLinkActive="active">Select</a>
30-
<a class="item" routerLink="/tabs" routerLinkActive="active">Tabs</a>
20+
<a class="item" routerLink="/components/accordion" routerLinkActive="active">Accordion</a>
21+
<a class="item" routerLink="/components/checkbox" routerLinkActive="active">Checkbox</a>
22+
<a class="item" routerLink="/components/collapse" routerLinkActive="active">Collapse</a>
23+
<a class="item" routerLink="/components/dimmer" routerLinkActive="active">Dimmer</a>
24+
<a class="item" routerLink="/components/dropdown" routerLinkActive="active">Dropdown</a>
25+
<a class="item" routerLink="/components/message" routerLinkActive="active">Message</a>
26+
<a class="item" routerLink="/components/progress" routerLinkActive="active">Progress</a>
27+
<a class="item" routerLink="/components/rating" routerLinkActive="active">Rating</a>
28+
<a class="item" routerLink="/components/search" routerLinkActive="active">Search</a>
29+
<a class="item" routerLink="/components/select" routerLinkActive="active">Select</a>
30+
<a class="item" routerLink="/components/tabs" routerLinkActive="active">Tabs</a>
3131
</div>
3232
</div>
3333
</div>

demo/app/app.routing.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,47 @@ const appRoutes: Routes = [
2121
component: GettingStartedPage,
2222
},
2323
{
24-
path: 'accordion',
24+
path: 'components/accordion',
2525
component: AccordionPage
2626
},
2727
{
28-
path: 'checkbox',
28+
path: 'components/checkbox',
2929
component: CheckboxPage
3030
},
3131
{
32-
path: 'collapse',
32+
path: 'components/collapse',
3333
component: CollapsePage
3434
},
3535
{
36-
path: 'dimmer',
36+
path: 'components/dimmer',
3737
component: DimmerPage
3838
},
3939
{
40-
path: 'dropdown',
40+
path: 'components/dropdown',
4141
component: DropdownPage
4242
},
4343
{
44-
path: 'message',
44+
path: 'components/message',
4545
component: MessagePage
4646
},
4747
{
48-
path: 'progress',
48+
path: 'components/progress',
4949
component: ProgressPage
5050
},
5151
{
52-
path: 'rating',
52+
path: 'components/rating',
5353
component: RatingPage
5454
},
5555
{
56-
path: 'search',
56+
path: 'components/search',
5757
component: SearchPage
5858
},
5959
{
60-
path: 'select',
60+
path: 'components/select',
6161
component: SelectPage
6262
},
6363
{
64-
path: 'tabs',
64+
path: 'components/tabs',
6565
component: TabsPage
6666
},
6767
{
@@ -75,8 +75,6 @@ const appRoutes: Routes = [
7575
}
7676
];
7777

78-
export const appRoutingProviders: any[] = [
79-
80-
];
78+
export const appRoutingProviders: any[] = [];
8179

8280
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);

demo/app/pages/getting-started/getting-started.page.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ <h2 class="ui dividing header">Installation</h2>
2626
<p>Now you're good to go!</p>
2727
<h2 class="ui dividing header">Dependencies</h2>
2828
<div class="ui bulleted list">
29-
<!--## Dependencies-->
30-
<!--* [Angular 2](https://angular.io) (tested with 2.0-rc.5)-->
31-
<!--* [Bootstrap 4](https://v4-alpha.getbootstrap.com) (tested with 4.0 alpha V3)-->
3229
<div class="item"><a href="https://angular.io">Angular 2</a> (2.0.0-rc.5)</div>
3330
<div class="item"><a href="http://semantic-ui.com/">Semantic UI CSS</a> (jQuery is <strong>not</strong> required)</div>
3431
</div>

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
"scripts": {
2424
"start": "ng serve",
2525
"lint": "tslint \"demo/**/*.ts\"",
26-
"test": "ng test",
27-
"pree2e": "webdriver-manager update",
28-
"e2e": "protractor"
26+
"compile": "tsc",
27+
"compile:w": "tsc -w"
2928
},
3029
"dependencies": {
3130
"@angular/common": "2.0.0-rc.5",

tsconfig.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"compilerOptions": {
3+
"declaration": true,
4+
"emitDecoratorMetadata": true,
5+
"experimentalDecorators": true,
6+
"lib": ["es6", "dom"],
7+
"mapRoot": "./",
8+
"module": "es6",
9+
"moduleResolution": "node",
10+
"sourceMap": true,
11+
"target": "es5",
12+
"typeRoots": [
13+
"node_modules/@types"
14+
],
15+
"types": [
16+
"jasmine"
17+
]
18+
},
19+
"files": [
20+
"index.ts",
21+
"components/index.ts"
22+
]
23+
}

0 commit comments

Comments
 (0)