title: How to redirect to another page on ng-click using angularjs or coffeescript?
body: <p>I am doing some tasks now in angularjs and coffeescript. I have a requirement like: I have couple of buttons in my html page like:</p>
  
  <pre><code>&lt;div&gt;
      &lt;button type="button" class="btn btn-default" ng-click="button1();"&gt;Button1&lt;/button&gt;
      &lt;button type="button" class="btn btn-default" ng-click="button2();"&gt;Button2&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I click on Button1, then it should redirect to another page(like: '/test1.html'), similarly, if I click on Button2, then it should redirect to another page(like: '/test2.html').
  How can I do this in AngularJS/CoffeeScript ?</p>
  
  <p>If I do in my coffeescript file, I am getting the below error:</p>
  
  <pre><code>app = angular.module('myApp', dependencies)
  app.controller 'WizardController', [
    '$scope',
    ($scope) -&gt;
    $scope.button1 = -&gt;
      window.location = '/test1.html'
      return
  
      $scope.button2 = -&gt;
      window.location = '/test2.html'
      return
    ]
  </code></pre>
  
  <p>but it is giving compilation error at return statement: Compilation error: Parse error on line 103: Unexpected 'TERMINATOR' </p>