Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.controller('MainCtrl', function($scope, $location, $anchorScroll) {
- this.toggleClass = function(elementId, className){
- angular.element('#' + elementId).toggleClass(className);
- };
- this.scrollTo = function(id) {
- $location.hash(id);
- $anchorScroll();
- $anchorScroll.yOffset = 100;
- };
- });
- app.controller('MainCtrl', function($scope, $location, $anchorScroll) {
- this.toggleClass = function(elementId, className){
- angular.element('#' + elementId).toggleClass(className);
- };
- this.scrollTo = function(id) {
- $location.url("/");
- $location.hash(id);
- $anchorScroll();
- $anchorScroll
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement