Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
angular-ui-switch
Advanced tools
Readme
This is a simple iOS 7 style switch directive for AngularJS. You can use this module as you would use the default HTML checkbox input element. This is a super lightweight module and you can completely change the design using just CSS.
Supported by all modern browsers: Chrome, Firefox, Opera, Safari, IE8+
Inspired by switchery - in angular way.
Download the package from github
. The package is also available over npm install angular-ui-switch
or bower install angular-ui-switch
.
Include javascript
and css
files into your page.
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
...
<link rel="stylesheet" href="/ui-switch.min.css"/>
</head>
<body>
...
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.3/angular.min.js"></script>
<script src="/ui-switch.min.js"></script>
</body>
</html>
Declare a dependency on the module.
angular.module('myModule', ['uiSwitch']);
Insert the switch in your html template.
<form>
<switch id="enabled" name="enabled" ng-model="enabled" class="green"></switch>
<br>{{ enabled }}
</form>
Add optional on/off text
<form>
<switch id="enabled" name="enabled" ng-model="enabled" on="On" off="Off" class="green"></switch>
<br>{{ enabled }}
</form>
Disabled state
<form>
<switch id="enabled" name="enabled" ng-model="enabled" disabled="true" class="green"></switch>
<br>{{ enabled }}
</form>
You can completely change the design. All the magic is hidden inside two CSS classes.
.switch {
/* frame */
}
.switch small {
/* button */
}
.switch.checked {
/* frame when enabled */
}
.switch.checked small {
/* button when enabled */
}
Update version in package.json
and bower.json
.
Run make compile
to minify files.
Run make publish
to publish.
FAQs
iOS 7 style switch directive for AngularJS
The npm package angular-ui-switch receives a total of 5,252 weekly downloads. As such, angular-ui-switch popularity was classified as popular.
We found that angular-ui-switch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.