Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
spirosikmd committed Oct 19, 2016
1 parent 6f0024a commit 2673918
Show file tree
Hide file tree
Showing 16 changed files with 37,922 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# Compiled angular 2 files
aot

# Generated compiled source files
*.js
*.d.ts
*.metadata.json

# Exclude the bundle demo file
!docs/bundle.js
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# angular2-focus
Angular2 directive that gives focus on an element depending on a given expression

Angular2 directive that gives focus on an element depending on a given expression.

## Install

`npm install --save angular2-focus`

## Example

```typescript
import {NgModule, Component} from '@angular/core';
import {Focsu} from 'angular2-focus';

@Component({
template: `
<input type="text" focus="true">
`
})
class AppComponent { }

@NgModule({
imports: [Focus],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
```

Check the [docs](docs) for a complete example.
8 changes: 8 additions & 0 deletions bs-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files": [
"./docs/**/*.{html,htm,css,js}"
],
"server": {
"baseDir": "./docs"
}
}
7 changes: 7 additions & 0 deletions docs/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {Component} from '@angular/core';
@Component({
selector: 'app',
templateUrl: 'app.html'
})
export class AppComponent {
}
20 changes: 20 additions & 0 deletions docs/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
body {
padding: 0;
margin: 0;
}

.aligner {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}

.aligner-item {
max-width: 50%;
}

.aligner-item--fixed {
flex: none;
max-width: 50%;
}
15 changes: 15 additions & 0 deletions docs/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="aligner">
<div class="aligner-item aligner-item--fixed">
<label>
<select focus="true">
<option>gluttony</option>
<option>greed</option>
<option>sloth</option>
<option>envy</option>
<option>wrath</option>
<option>pride</option>
<option>lust</option>
</select>
</label>
</div>
</div>
11 changes: 11 additions & 0 deletions docs/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {AppComponent} from './app.component';
import {Focus} from '../index';
@NgModule({
imports: [BrowserModule, Focus],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {
}
Loading

0 comments on commit 2673918

Please sign in to comment.