Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
7a2c73f0
Commit
7a2c73f0
authored
Jul 04, 2017
by
dev0tion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add focus directive
parent
c9c92c37
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
auto-focus.directive.spec.ts
...UI/src/app/shared/directives/auto-focus.directive.spec.ts
+8
-0
auto-focus.directive.ts
Breeze.UI/src/app/shared/directives/auto-focus.directive.ts
+15
-0
shared.module.ts
Breeze.UI/src/app/shared/shared.module.ts
+3
-2
No files found.
Breeze.UI/src/app/shared/directives/auto-focus.directive.spec.ts
0 → 100644
View file @
7a2c73f0
import
{
AutoFocusDirective
}
from
'./auto-focus.directive'
;
describe
(
'AutoFocusDirective'
,
()
=>
{
it
(
'should create an instance'
,
()
=>
{
const
directive
=
new
AutoFocusDirective
();
expect
(
directive
).
toBeTruthy
();
});
});
Breeze.UI/src/app/shared/directives/auto-focus.directive.ts
0 → 100644
View file @
7a2c73f0
import
{
Directive
,
Renderer
,
ElementRef
,
OnInit
}
from
'@angular/core'
;
@
Directive
({
selector
:
'[myAutoFocus]'
})
export
class
AutoFocusDirective
implements
OnInit
{
constructor
(
private
renderer
:
Renderer
,
private
elementRef
:
ElementRef
)
{
}
ngOnInit
()
{
this
.
renderer
.
invokeElementMethod
(
this
.
elementRef
.
nativeElement
,
'focus'
,
[]
);
}
}
Breeze.UI/src/app/shared/shared.module.ts
View file @
7a2c73f0
import
{
NgModule
,
ModuleWithProviders
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
CoinNotationPipe
}
from
'./pipes/coin-notation.pipe'
;
import
{
AutoFocusDirective
}
from
'./directives/auto-focus.directive'
;
@
NgModule
({
imports
:
[
CommonModule
],
declarations
:
[
CoinNotationPipe
],
exports
:
[
CoinNotationPipe
]
declarations
:
[
CoinNotationPipe
,
AutoFocusDirective
],
exports
:
[
CoinNotationPipe
,
AutoFocusDirective
]
})
export
class
SharedModule
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment