Skip to content

Commit

Permalink
Merge pull request #14 from jfcere/fix-angular-dependencies
Browse files Browse the repository at this point in the history
Fix for Angular dependencies when using Angular-CLI
  • Loading branch information
dimpu authored Jan 26, 2017
2 parents b0628fa + ef7b6cc commit b104c63
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,32 @@
Source @ [https://github.com/dimpu/angular2-markdown]()


##setup

## Setup
```bash
npm i angular2-markdown --save
npm i angular2-markdown --save
```

##How to use it
## How to use it
### app.module.js
```typescript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import {MarkdownModule} from 'angular2-markdown';
import {AppComponent} from '../src/app.component';
import { MarkdownModule } from 'angular2-markdown';
import { AppComponent } from '../src/app.component';

@NgModule({
imports: [
BrowserModule,
MarkdownModule,
MarkdownModule.forRoot(),
],
declarations: [AppComponent],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})

```

app.component.html
### app.component.html
```html
<div Markdown>
### your markdown code
Expand All @@ -42,22 +41,18 @@ or use angular component

// to load from remote url

<div Markdown path="/path/to/readme.md"> </div>
<div Markdown path="/path/to/readme.md"></div>

// load remote source code with auto syantax helight.


<markdown path="/path/to/code.cpp"></markdown>


<markdown path="/path/to/code.java"></markdown>


```

## example
## Example

You can found the working example inside the src/app/demo directory.
You can found the working example inside the `src/app/demo directory`.

```
git clone https://github.com/dimpu/angular2-markdown.git
Expand All @@ -67,5 +62,3 @@ npm i
ng serve
```
now you should see working example at [http://localhost:4200]()


10 changes: 8 additions & 2 deletions src/app/markdown/markdown.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NgModule } from '@angular/core';
import { ModuleWithProviders, NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import { MarkdownComponent } from './markdown.component';
import { MarkdownService } from './markdown.service';
Expand All @@ -9,4 +9,10 @@ import { MarkdownService } from './markdown.service';
declarations: [MarkdownComponent],
providers: [MarkdownService],
})
export class MarkdownModule { }
export class MarkdownModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: MarkdownModule,
};
}
}

0 comments on commit b104c63

Please sign in to comment.