Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. app.controller('MainCtrl', function($scope, $location, $anchorScroll) {
  2.  
  3. this.toggleClass = function(elementId, className){
  4. angular.element('#' + elementId).toggleClass(className);
  5. };
  6.  
  7. this.scrollTo = function(id) {
  8. $location.hash(id);
  9. $anchorScroll();
  10. $anchorScroll.yOffset = 100;
  11. };
  12. });
  13.  
  14. app.controller('MainCtrl', function($scope, $location, $anchorScroll) {
  15.  
  16. this.toggleClass = function(elementId, className){
  17. angular.element('#' + elementId).toggleClass(className);
  18. };
  19.  
  20. this.scrollTo = function(id) {
  21. $location.url("/");
  22. $location.hash(id);
  23. $anchorScroll();
  24. $anchorScroll
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement