angular-simple-focus

WebJar for angular-simple-focus

Лицензия

Лицензия

MIT
Категории

Категории

Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

angular-simple-focus
Последняя версия

Последняя версия

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-simple-focus
WebJar for angular-simple-focus
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/deltreey/angular-simple-focus

Скачать angular-simple-focus

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-simple-focus/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-simple-focus</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-simple-focus/
implementation 'org.webjars.bower:angular-simple-focus:0.0.1'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-simple-focus/
implementation ("org.webjars.bower:angular-simple-focus:0.0.1")
'org.webjars.bower:angular-simple-focus:jar:0.0.1'
<dependency org="org.webjars.bower" name="angular-simple-focus" rev="0.0.1">
  <artifact name="angular-simple-focus" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-simple-focus', version='0.0.1')
)
libraryDependencies += "org.webjars.bower" % "angular-simple-focus" % "0.0.1"
[org.webjars.bower/angular-simple-focus "0.0.1"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar [1,2)

Модули Проекта

Данный проект не имеет модулей.

angular-simple-focus

An attribute to focus an element when it appears and by a value.

It's a simple angularjs directive that focuses an input when it appears and whenever you set a value to true. This means that this works to set the focus on page load, and as an element is created as part of an ng-repeat and of course it can be set manually.

Because it's such a small amount of code, it should be able to read and understand so you can even tweak it for your needs. In fact, I encourage it!

Available on Bower

bower install angular-simple-focus

How To

Simply include the simple-focus module

var app = angular.module('app', [ 'simple-focus' ]);

Then use the simple-focus attribute on your html elements

<input type="text" simple-focus="someValue" />

Note that the simple-focus attribute must have a value, but that value is arbitrary, so pick whatever you want. The value is pulled in from your controller's $scope, so $scope.someValue in my controller is the value for the simple-focus attribute above. If I set $scope.someValue = true; in my controller, the input would get focus.

There are lots of different directives just like this one. And lots of people have attempted to explain it in examples In fact, this code is almost an exact copy of this example gist. I built this one because none of the other ones worked exactly this way, most of them were just examples, not a project that people could feel like they were a part of, and most of them were much more complicated both to use and to develop for. This one is simple. If it doesn't perfectly fit your needs, I have confidence it will help you understand enough to redesign it for yourself. I'll even happily accept pull requests and issues to improve it.

Check out the github pages example here: http://deltreey.github.io/angular-simple-focus/

Версии библиотеки

Версия
0.0.1