Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Angular dependencies when using Angular-CLI #14

Merged
merged 1 commit into from
Jan 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
};
}
}