Comments (3)
@ipiz Thanks for the quick reply!
Unfortunately I couldn't get it to work quite right (possibly because of my specific layout where the steps are inside a scrollable div). But, I found an angular scroll directive (https://github.com/oblador/angular-scroll) that ended up working just fine.
from md-steppers.
@jpnkicker14 you can use $anchorScroll
and $location.hash
<div id="the-anchor">
<md-steppers>
<md-step>
<!-- code here -->
<md-button ng-click="vm.saveStepAndForward('the-anchor')">
</md-step>
<md-step>
<!-- code here -->
<md-button ng-click="vm.saveStepAndForward('the-anchor')">
</md-step>
</md-steppers>
</div>
//example
function gotoAnchor(x) {
var newHash = x;
if ($location.hash() !== newHash) {
// set the $location.hash to `newHash` and
// $anchorScroll will automatically scroll to it
$location.hash(x);
} else {
// call $anchorScroll() explicitly,
// since $location.hash hasn't changed
$anchorScroll();
}
}
vm.saveStepAndForward = saveStepAndForward;
function saveStepAndForward(anchor) {
vm.stepBusy = true;
gotoAnchor(anchor);
$timeout(function () {
vm.activeStep = 2;
vm.steps.step1.completed = true;
vm.steps.step2.enabled = true;
vm.stepBusy = false;
}, 1000);
}
from md-steppers.
@jpnkicker14 here is a fiddle for you:
from md-steppers.
Related Issues (20)
- Scrolling performance on iPhone 6 Plus (Safari and Chrome) HOT 5
- Angular Material 1.10-rc2 css and md-visually-hidden md-dummy-wrapper HOT 6
- Bower Dependencie HOT 2
- Not able to navigate back to previous steps in IE (by clicking steps header) HOT 6
- Changing default colors
- Add steps dynamically HOT 6
- md-completed adds content: '7'; to the step label HOT 5
- alternative labels HOT 2
- Error/Invalid Steps HOT 2
- vertical steppers not implemented? HOT 1
- Usage in a md-dialog (bug with ie11) HOT 2
- Angular 2/4 HOT 1
- Steppers not taking full height HOT 2
- Step label ellipsis for long labels? HOT 3
- No init after upgrading to AngularJS v1.6.7
- md-stepper not working on IE11 HOT 1
- https://www.google.com HOT 2
- Bootstrap Steps HOT 1
- Unable to link md-steppers.min.js in index.html
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from md-steppers.