
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
angular-ws-steps
Advanced tools
Demo: https://wpdas.github.io/angular-ws-steps/
bower install angular-ws-steps --save
npm install angular-ws-steps --save
The following files must be used:
<link rel="stylesheet" href="bower_components/angular-ws-steps/src/steps.css">
<script src="bower_components/angular-ws-steps/src/steps.directive.js"></script>
<link rel="stylesheet" href="node_modules/angular-ws-steps/src/steps.css">
<script src="node_modules/angular-ws-steps/src/steps.directive.js"></script>
The component can be used in the same document as many times as long as the id of the steps is different. Otherwise a warning will be issued on the console.
If the requested step is larger than the enabled step, it will not be displayed.
When the enabled step is changed, if the current step is larger than it, the first step will be automatically selected.
Note: title and ref parameter from step directive are optional.
<steps step="3" enabled-step="3" id="idName">
<step icon="icon_name" title="title" ref="idRef1"></step>
<step icon="icon_name" title="title" ref="idRef2"></step>
<step icon="icon_name" title="title" ref="idRef3"></step>
</steps>
<step-content id="idRef1">HTML content</step-content>
<step-content id="idRef2">HTML content</step-content>
<step-content id="idRef3">HTML content</step-content>
You can use optional parameter "colors" to set colors of steps in sequence: enabled-color, disabled-color and enabled-icon-color. Caution, in this mode, you only can use HEX colors type. If you want to use rgb, rgba or similar, use StepAPI.init() instance.
<steps step="3" enabled-step="3" id="idName" colors="#ff0000, #765fff, #0000ff">
...
</steps>
angular.module('app', ['wsSteps'])
.controller('AppCtrl', function(StepsAPI){
var myNav = new StepsAPI.init('idName');
});
css #1976D2;
), disabled-color(css rgba(0,0,0,.38)
), enabled-icon-color(css rgba(25, 118, 210, 0.70)
).
To change default colors inject and use StepColors object like this:angular.module('app', ['wsSteps'])
.controller('AppCtrl', function(StepsAPI, StepColors) {
//(enabledColor, disabledColor, enabledIconColor)
var stepColors = new StepColors('#ff0000', 'rgba(180, 76, 93, 0.70)', '#0000ff');
var myNav = new StepsAPI.init('idName', stepColors);
});
You can made too:
angular.module('app', ['wsSteps'])
.controller('AppCtrl', function(StepsAPI) {
var myNav = new StepsAPI.init('idName');
myNav.onReady(function() {
myNav.setEnabledColor('#ff0000');
myNav.setDisabledColor('rgba(180, 76, 93, 0.70)');
myNav.setEnabledIconColor('#0000ff');
});
});
<div ng-controller="AppCtrl as vm">
<steps step="{vm.currentStep}" enabled-step="{vm.currentEnabledStep}" id="idName">
...
</steps>
</div>
.controller('AppCtrl', function(StepsAPI){
var myNav = new StepsAPI.init('idName');
//API events
//Shot when every component (including child objects) has been drawn. This event should only be used if immediate use of the API is required
myNav.onReady(function() {
myNav.getElement(); //HTML element being controlled.
myNav.getElementId(); //Element ID.
myNav.getTotalSteps(); //Total steps of component/directive.
myNav.getStep(); //Current step.
myNav.setStep(1); //Change to Step passed by parameter.
myNav.getEnabledStep(); //Current position of Enabled Step.
myNav.setEnabledStep(4); //Sets a new position for Enabled Step.
myNav.setEnabledColor('#ff0000'); //Sets enabled color.
myNav.setDisabledColor('rgba(180, 76, 93, 0.70)'); //Sets disabled color.
myNav.setEnabledIconColor('#0000ff'); //Sets enabled icon color.
myNav.update() //Updates the step and enabled-step based on current value setted on HTML tag.
});
//When the Step is changed
myNav.onStepChange(function() {
console.log('Step Changes');
});
//When the Enabled Step is changed
myNav.onEnabledStepChange(function() {
console.log('Enabled Step Changes');
});
//When the Step can not be assigned due to the Enable Step lock.
myNav.onStepChangeNotAllowed(function(err) {
console.error(err);
});
});
<!-- css -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="/bower_components/angular-material/angular-material.css">
<!-- js -->
<script src="/bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-aria/angular-aria.js"></script>
<script src="/bower_components/angular-animate/angular-animate.js"></script>
<script src="/bower_components/angular-material/angular-material.js"></script>
License MIT.
FAQs
Steps directive for AngularJS. Works like the Tabs. Easy to use.
The npm package angular-ws-steps receives a total of 4 weekly downloads. As such, angular-ws-steps popularity was classified as not popular.
We found that angular-ws-steps 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.