diff --git a/.gitignore b/.gitignore
index 431d204..9147ce9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,39 @@
+/.angular/cache
+# Node
+node_modules/*
npm-debug.log
-node_modules
-example/node_modules
+
+# TypeScript
+src/*.js
+src/*.map
+src/*.d.ts
+
+# JetBrains
.idea
-.npmignore
\ No newline at end of file
+.project
+.settings
+.idea/*
+*.iml
+
+# VS Code
+.vscode/*
+
+# Windows
+Thumbs.db
+Desktop.ini
+
+# Mac
+.DS_Store
+**/.DS_Store
+
+# Ngc generated files
+**/*.ngfactory.ts
+
+# Build files
+dist/*
+
+# Playground tmp files
+.playground
+
+# Docs
+docs/*
diff --git a/.npmignore b/.npmignore
new file mode 100644
index 0000000..fdb7f4f
--- /dev/null
+++ b/.npmignore
@@ -0,0 +1,34 @@
+# Node
+node_modules/*
+npm-debug.log
+docs/*
+# DO NOT IGNORE TYPESCRIPT FILES FOR NPM
+# TypeScript
+# *.js
+# *.map
+# *.d.ts
+
+# JetBrains
+.idea
+.project
+.settings
+.idea/*
+*.iml
+
+# VS Code
+.vscode/*
+
+# Windows
+Thumbs.db
+Desktop.ini
+
+# Mac
+.DS_Store
+**/.DS_Store
+
+# Ngc generated files
+**/*.ngfactory.ts
+
+# Library files
+src/*
+build/*
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..24f9d2a
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,56 @@
+# 2.0.0
+
+### Notes
+
+* Added template context management
+
+# 0.9.5
+
+### Notes
+
+* Notifications now use ChangeDetectionStrategy.OnPush
+
+# 0.9.4
+
+### Features
+
+* Extended position to support "middle" and "center" as options
+
+# 0.9.0
+
+### Notes
+
+* Refactored build system to support AOT and Angular version 5.
+
+### Features
+
+* Title and content now support TemplateRef and HTML
+
+# 0.7.0
+
+### Breaking Changes
+
+* Removed BrowserAnimationModule from SimpleNotificationsModule.
+BrowserAnimationsModule now needs to be imported in the projects module to use the library.
+
+# 0.6.0
+
+### Features
+
+* Added warn toast notification type
+
+# 0.5.4
+
+### Notes
+
+* Updated tsconfig to target es5
+
+# 0.5.0
+
+### Notes
+
+* Version 0.5 has had some mayor refactoring
+* Update to angular 4.0.1
+* Folder structure refactor
+* All types are now exported
+* A lot of minor bug fixes
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d384123
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Filip Lauc
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/README.md b/README.md
index 89c8d33..7a81d0e 100644
--- a/README.md
+++ b/README.md
@@ -1,91 +1,303 @@
# Angular2-Notifications
-An easy to use notifications library for Angular 2.
+
+> A light and easy to use notifications library for Angular 2. ~~It features both regular page notifications (toasts) and push notifications.~~
+
+[](https://travis-ci.org/flauc/angular2-notifications)
+[](https://www.npmjs.com/package/angular2-notifications)
+[](https://www.npmjs.com/package/angular2-notifications)
+
+**Push Notifications have been moved to a separate library [ng-push](https://github.com/flauc/ng-push)**
+
+## Table of Contents
+
+ - [Example](#example)
+ - [Setup](#setup)
+ - [SystemJS](#systemjs)
+ - [Webpack](#webpack)
+ - [Setup](#setup)
+ - [Creating Notifications](#crating-notifications)
+ - [Example using TemplateRef](#example-using-templateref)
+ - [Subscribing to clicks](#subscribing-to-clicks)
+ - [Options](#options)
+
+## Example
+
+Take a look at the live demo here: [Live Demo](https://stackblitz.com/edit/angular2-notifications-example)
## Setup
-Download the library with npm
-```
+
+Install the library
+
+```sh
npm install --save angular2-notifications
+# Or using Yarn for a faster installation
+yarn add angular2-notifications
```
-Map the library in your System.config if you're using SystemJs.
+### SystemJS
+
+Map the library in your `system.config.js` if you're using SystemJs.
+
+```js
+var map = {
+ 'angular2-notifications': 'node_modules/angular2-notifications'
+}
+
+var packages = {
+ 'angular2-notifications': { main: './dist/index.js', defaultExtension: 'js' }
+}
```
-System.config({
- map: {
- 'notifications': 'node_modules/angular2-notifications'
- }
-});
+
+### Webpack
+
+If you're using Webpack >= 2, just include the library in your `main.ts` or `vendor.ts` file
+
+```ts
+import 'angular2-notifications';
```
-Add the NotificationComponent in to the component where you want to use the notifications.
+## Setup
+
+Import the `SimpleNotificationsModule` in to your root `AppModule` (it will not work if you try to import it into a shared module)
+```ts
+import { SimpleNotificationsModule } from 'angular2-notifications';
+
+@NgModule({
+ imports: [
+ BrowserModule,
+ // Animations need to be imported in to your project to use the library
+ BrowserAnimationsModule,
+ SimpleNotificationsModule.forRoot()
+ ],
+ declarations: [AppComponent],
+ bootstrap: [AppComponent]
+})
+export class AppModule { }
```
+
+
+Add the SimpleNotificationsComponent in to the component where you want to use the notifications. Or in your top level component for use in child components.
+```js
...
-directives: [NotificationComponent],
-template: ''
+template: ''
...
```
You will also need to use the NotificationsService in your component to create or remove the notifications.
-```typescript
-...
-providers: [NotificationsService]
+```js
...
constructor( private _service: NotificationsService ) {}
...
```
+
+The create and destroy Event Emitters emit the notification that was created or destroyed you can utilise this functionality like this:
+```js
+
+```
+
+**If your app cannot find the built JS files for this package,** you may need to tell your build script to scan the `angular2-notifications` directory. See the related issue [#25](https://github.com/flauc/angular2-notifications/issues/25). Example:
+
+```js
+'angular2-notifications/*.+(js|js.map)',
+'angular2-notifications/lib/*.+(js|js.map)'
+```
+
+## Creating Notifications
+
This are the currently available access methods:
-* `success(title: string, content: string, override?: any)` - Creates a success notification with the provided title and content.
-* `error(title: string, content: string, override?: any)` - Creates an error notification with the provided title and content.
-* `alert(title: string, content: string, override?: any)` - Creates an alert notification with the provided title and content.
-* `removeAll()` - Closes all currently open notifications.
+
+* The access methods return the constructed notification along with the created id.
+
+| Method | Description
+---| ---
+`success(title: any, content?: any, override?: any, context?: any)` | Creates a success notification with the provided title and content.
+`error(title: any, content?: any, override?: any, context?: any)` | Creates an error notification with the provided title and content.
+`alert(title: any, content?: any, override?: any, context?: any)` | Creates an alert notification with the provided title and content.
+`warn(title: any, content?: any, override?: any, context?: any)` | Creates a warn notification with the provided title and content.
+`info(title: any, content?: any, override?: any, context?: any)` | Creates an info notification with the provided title and content.
+`bare(title: any, content?: any, override?: any, context?: any)` | Creates a bare notification with the provided title and content. This notification type is best used when adding custom html.
+`create(title: any, content: any = '', type: string = 'success', override?: any, context?: any)` | Use this method to create any notification type ['success', 'error', 'alert', 'info', 'bare'].
+`html(html: any, type: string = 'success', override?: any, icon: string = 'bare', context?: any)` | Use this method to create a notification with custom html. By specifying an icon (success, error, alert, info or warn) you can use the default icons in addition to your custom html. If you do not explicitly pass an icon param no icon will be shown by default.
+`remove(id?: string)` | Removes the notification that has the provided id or removes all currently open notifications if no id was provided.
+
+The `title`, `content` and `html` arguments can be a string, html string or `TemplateRef`. Now it's also possible to pass the datas (context) to the `TemplateRef` by using the optional `context` argument.
+
+### Example using `TemplateRef`
+
+To use a `TemplateRef` in the title or content you need to create it in a component template:
+
+```html
+
+