2014-07-08 07:02:26 -04:00
|
|
|
define [
|
|
|
|
"base"
|
|
|
|
], (App) ->
|
2014-07-25 07:32:26 -04:00
|
|
|
App.controller "PlansController", ($scope, $modal, event_tracking) ->
|
2014-07-21 06:33:10 -04:00
|
|
|
|
2014-07-08 07:02:26 -04:00
|
|
|
$scope.ui =
|
2014-07-21 06:33:10 -04:00
|
|
|
view: "monthly"
|
|
|
|
|
|
|
|
$scope.signUpNowClicked = (plan, annual)->
|
|
|
|
if $scope.ui.view == "annual"
|
|
|
|
plan = "#{plan}_annual"
|
|
|
|
event_tracking.send 'subscription-funnel', 'sign_up_now_button', plan
|
|
|
|
|
|
|
|
$scope.switchToMonthly = ->
|
|
|
|
$scope.ui.view = "monthly"
|
|
|
|
event_tracking.send 'subscription-funnel', 'plans-page', 'monthly-prices'
|
|
|
|
|
|
|
|
$scope.switchToStudent = ->
|
|
|
|
$scope.ui.view = "student"
|
|
|
|
event_tracking.send 'subscription-funnel', 'plans-page', 'student-prices'
|
|
|
|
|
|
|
|
$scope.switchToAnnual = ->
|
|
|
|
$scope.ui.view = "annual"
|
|
|
|
event_tracking.send 'subscription-funnel', 'plans-page', 'student-prices'
|
2014-07-25 07:32:26 -04:00
|
|
|
|
|
|
|
$scope.openGroupPlanModal = () ->
|
|
|
|
$modal.open {
|
|
|
|
templateUrl: "groupPlanModalTemplate"
|
|
|
|
}
|