angular.module('tutorials', []) .directive('docTutorialNav', ['templateMerge' ,function(templateMerge) { var pages = [ '', 'step_00', 'step_01', 'step_02', 'step_03', 'step_04', 'step_05', 'step_06', 'step_07', 'step_08', 'step_09', 'step_10', 'step_11', 'step_12', 'the_end' ]; return { compile: function(element, attrs) { var seq = 1 * attrs.docTutorialNav, props = { seq: seq, prev: pages[seq], next: pages[2 + seq], diffLo: seq ? (seq - 1): '0~1', diffHi: seq }; element.addClass('btn-group'); element.addClass('tutorial-nav'); element.append(templateMerge( '
  • Previous
  • \n' + '
  • Live Demo
  • \n' + '
  • Code Diff
  • \n' + '
  • Next
  • ', props)); } }; }]) .directive('docTutorialReset', function() { return { scope: { 'step': '@docTutorialReset' }, template: '

    Workspace Reset Instructions ➤

    \n' + '
    \n' + '

    Reset the workspace to step {{step}}.

    ' + '

    git checkout -f step-{{step}}

    \n' + '

    Refresh your browser or check out this step online: '+ 'Step {{step}} Live Demo.

    \n' + '
    \n' + '

    The most important changes are listed below. You can see the full diff on ' + 'GitHub\n' + '

    ' }; });