Skip to content

Commit

Permalink
feat($app): initial commit
Browse files Browse the repository at this point in the history
initial creation and commit post update from ng2-gist to work with Angular 4
  • Loading branch information
Jason Hodges committed Apr 26, 2017
1 parent 42a96ec commit 3c31927
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Thumbs.db
*.ts
!*.d.ts

examples
docs
src
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# ng2-gist
Angular 2 Component for embedding a gist within an Angular site
# ng-gist
Angular 4 Component for embedding a gist within an Angular site

[![Build Status](https://travis-ci.org/jasonhodges/ng2-gist.svg?branch=master)](https://travis-ci.org/jasonhodges/ng2-gist)
[![Build Status](https://travis-ci.org/jasonhodges/ng-gist.svg?branch=master)](https://travis-ci.org/jasonhodges/ng-gist)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)


## Code Example

In order to use the component in your Angular 2 project after installation, follow these steps:
In order to use the component in your Angular 4 project after installation, follow these steps:

- Declare `ng2Gist` within app.module.ts
- Declare `ngGist` within app.module.ts

```@NgModule({
declarations: [
AppComponent,
ng2Gist
ngGist
],
imports: [
BrowserModule,
Expand All @@ -26,17 +26,17 @@ In order to use the component in your Angular 2 project after installation, foll
})
export class AppModule { }
```
- Use the `ng2-gist` component in any template files by using the `ng2-gist` tag along with username and gistId
- Use the `ng-gist` component in any template files by using the `ng-gist` tag along with username and gistId
```html
<ng2-gist [gistId]="'{username}/{gistId}'"></ng2-gist>
<ng-gist [gistId]="'{username}/{gistId}'"></ng-gist>
```

## Motivation
This project was initiated after a search for an Angular 2 component of its kind returned no results.
This project was initiated after a search for an Angular 4 component of its kind returned no results.

## Installation

`npm i --save ng2-gist`
`npm i --save ng-gist`

## Contributors

Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './lib/ng2-gist.component';
export * from './lib/ngx-gist.component';
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
exports.ng2Gist = require('./lib/ng2-gist.component').ng2Gist;
exports.ngxGist = require('./lib/ngx-gist.component').ngxGist;
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "ng2-gist",
"name": "ngx-gist",
"version": "1.0.0",
"description": "Angular 2 Component for embedding a gist within an Angular site",
"main": "bundles/ng2-gist.umd.js",
"description": "Angular 4 Component for embedding a gist within an Angular site",
"main": "bundles/ngx-gist.umd.js",
"module": "index.js",
"scripts": {
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
Expand All @@ -12,29 +12,30 @@
"typings": "./index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/jasonhodges/ng2-gist.git"
"url": "https://github.com/jasonhodges/ngx-gist.git"
},
"keywords": [
"angular2",
"angular",
"angular 4",
"typescript",
"gist",
"angular2-gist"
"ngx-gist"
],
"author": "Jason Hodges <[email protected]>",
"license": "MIT",
"bugs": {
"url": "https://github.com/jasonhodges/ng2-gist/issues"
"url": "https://github.com/jasonhodges/ngx-gist/issues"
},
"homepage": "https://github.com/jasonhodges/ng2-gist#readme",
"homepage": "https://github.com/jasonhodges/ngx-gist#readme",
"devDependencies": {
"typescript": "^2.1.4",
"webpack": "^1.14.0"
},
"dependencies": {
"@angular/common": "^2.4.2",
"@angular/compiler": "^2.4.2",
"@angular/core": "^2.4.2",
"@angular/common": "^4.0.3",
"@angular/compiler": "^4.0.3",
"@angular/core": "^4.0.3",
"rxjs": "^5.0.3",
"zone.js": "^0.7.4"
"zone.js": "^0.8.9"
}
}
4 changes: 2 additions & 2 deletions src/ng2-gist.component.ts → src/ngx-gist.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {Component, Input, ViewChild, ElementRef, AfterViewInit} from '@angular/core';

@Component({
selector: 'ng2-gist',
selector: 'ngx-gist',
template:`
<iframe #iframe type="text/javascript" width="100%" frameborder="0"></iframe>
`,
styleUrls: []
})

export class ng2Gist implements AfterViewInit {
export class ngxGist implements AfterViewInit {
@ViewChild('iframe') iframe:ElementRef;
@Input() gistId;

Expand Down
15 changes: 11 additions & 4 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,22 @@
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"module": "commonjs",
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"removeComments": true,
"sourceMap": true,
"outDir": "../lib",
"declaration": true
"declaration": true,
"lib": ["es2015", "dom"]
},
"files": [
"../src/ngx-gist.component.ts"
],
"exclude": [
"node_modules"
]
],
"angularCompilerOptions": {
"skipTemplateCodegen": true
}
}

0 comments on commit 3c31927

Please sign in to comment.