1. 下载安装

    bower install angular-tour
    
  2. 建立依赖,引入文件

    <script src="bower_components/jquery/jquery.js"></script>
    <script src="bower_components/angular/angular.js"></script>
    <script src="bower_components/angular-tour/dist/angular-tour-tpls.min.js"></script>
  3. 使用  首先建立<tour>元素进行包裹
    // step 关联$scope.currentStep,默认为-1,为0时自动执行;
    // post-tour 执行完成时执行
    // post-step 最后一步时被调用
    // tour-complete 每次步数改变时执行
    <tour step="currentStep" post-tour="postTourCallback()" post-step="postStepCallback()" tour-complete="tourCompleteCallback()">
    <virtual-step
    // 标题
    tourtip="Angular Tour allows you to give an interactive tour to showcase the features of your website."
    // 下一步按钮内容
    tourtip-next-label="Learn more"
    // 出现位置
    tourtip-placement="right"
    // 步数
    tourtip-step="0"
    // 调转目标 id为e0的元素
    tourtip-element="#e0"></virtual-step>
    <virtual-step
    tourtip="Angular tour has some cool features."
    tourtip-placement="right"
    tourtip-step="1"
    tourtip-element="#e1"></virtual-step>
    <virtual-step
    tourtip="And is tested in all major browsers."
    tourtip-next-label="Continue"
    tourtip-placement="bottom"
    tourtip-step="2"
    tourtip-element="#e2"></virtual-step>
    <virtual-step
    tourtip="Thanks for reading. Head over to the github page for more info."
    tourtip-next-label="Finish"
    tourtip-placement="left"
    tourtip-step="3"
    tourtip-element="#e3"></virtual-step>
    </tour>

      

  4. angularjs内容启动
    angular.module('demoApp', ['angular-tour', 'ngCookies'])
    .controller('DemoCtrl', function($scope, $cookies) {
    // $scope.currentStep 从cookie中获取 var curStep = $cookies.get('myTour');
    if(typeof curStep === 'string')
    curStep = parseInt(curStep); $scope.currentStep = curStep || 0; $scope.postTourCallback = function() {
    console.log('tour closes');
    }; $scope.tourCompleteCallback = function() {
    console.log('tour completed');
    } $scope.postStepCallback = function() {
    console.log('Tour - Update Step', $scope.currentStep);
    $cookies.put('myTour', $scope.currentStep);
    };
    });

     

angular-tour 用户新手引导的更多相关文章

  1. ANGULAR 开发用户选择器指令

    在开发表单时,我们需要使用经常需要使用到用户选择器,用户的数据一般使用如下方式存储: 用户1,用户2,用户3   我们可以使用angular指令实现选择器. <!DOCTYPE html> ...

  2. angular源码分析:angular中各种常用函数,比较省代码的各种小技巧

    angular的工具函数 在angular的API文档中,在最前面就是讲的就是angular的工具函数,下面列出来 angular.bind //用户将函数和对象绑定在一起,返回一个新的函数 angu ...

  3. Angular CLI behind the scenes, part one

    原文:https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art074 --------------------------- ...

  4. Angular 1 深度解析:脏数据检查与 angular 性能优化

    TL;DR 脏检查是一种模型到视图的数据映射机制,由 $apply 或 $digest 触发. 脏检查的范围是整个页面,不受区域或组件划分影响 使用尽量简单的绑定表达式提升脏检查执行速度 尽量减少页面 ...

  5. JavaScript富应用MVC MVVM框架

    对框架的挑选 Ember.js.Backbone.js.Knockout.js.Spine.js.Batman.js , Angular.js 1. 轻量级的应用选择哪一个会比较好?2. 那一个比较简 ...

  6. 使用Angularjs和Vue.js对比

    使用Angularjs和Vue.js对比 之前项目都是使用Angularjs,(注明此处主要讲Angularjs 1)在初步使用Vue.js后做一个简答的对比笔记. 首先从理论上简单说一下各自的特点, ...

  7. [译]为什么Vue不支持templateURL

    原文链接 Vue的新用户最常问的一个问题,特别是以前使用Angular的用户,是"我可以使用" templateURL吗?这个问题我回答过很多次,现在写一个统一回复. 在Angul ...

  8. vuejs angularjs 框架的一些比较(vue项目重构四)

    使用Angularjs和Vue.js对比 首先需要说明的是:现在默认angularjs指angular1.0+版本,angular默认指2.0以上版本.本文的名词也默认指定angular的1.0+版本 ...

  9. angular7新特性

    Angular 是最流行的 Web 应用程序开发框架之一.随着 Angular 7 的发布,它为 Web 开发人员带来了更多功能,包括核心框架.Angular Material.与主要版本保持同步的 ...

随机推荐

  1. socket编程中write、read和send、recv之间的区别

    http://blog.csdn.net/petershina/article/details/7946615 一旦,我们建立好了tcp连接之后,我们就可以把得到的fd当作文件描述符来使用. 由此网络 ...

  2. 【转】深入研究java.lang.Runtime类

    一.概述      Runtime类封装了运行时的环境.每个 Java 应用程序都有一个 Runtime 类实例,使应用程序能够与其运行的环境相连接.      一般不能实例化一个Runtime对象, ...

  3. UPDATE和SELECT嵌套使用

    1 2 update a set HIGH=b.NEW  from SPEC1 a,tmpDOT  b  where a.high=b.old

  4. CAS SiteMinder (单点登录)

    http://www.ibm.com/developerworks/cn/opensource/os-cn-cas/

  5. 图模型的统计推断 inference in graphical models(马尔科夫链的推断)

    有关因子图(factor graphs)以及其在sum product 算法,max-algorithm中的应用,将在一下篇博客中分享. 谢谢您的关注,欢迎提出意见问题.

  6. zookeeper入门必读

    (如果感觉有帮助,请帮忙点推荐,添加关注,谢谢!你的支持是我不断更新文章的动力.本博客会逐步推出一系列的关于大型网站架构.分布式应用.设计模式.架构模式等方面的系列文章) 今天我想谈谈zookeepe ...

  7. DSP6455 DSP/BIOS中断配置问题(是否需要ECM-事件组合以及实例)

    2013-06-20 21:08:48 中断的配置有两种常用的方式: 一是通过CSL提供的API进行配置,这种方法相对DSP/BIOS偏底层,也比较麻烦:这种方法要求对中断系统的工作方式很清楚. 二是 ...

  8. poj 2965 The Pilots Brothers' refrigerator枚举(bfs+位运算)

    //题目:http://poj.org/problem?id=2965//题意:电冰箱有16个把手,每个把手两种状态(开‘-’或关‘+’),只有在所有把手都打开时,门才开,输入数据是个4*4的矩阵,因 ...

  9. 安装php 带debug

    gdb安装包   在CentOS6.4下使用gdb进行调试的时候, 使用bt(breaktrace)命令时,会弹出如下的提示: 头一天提示: Missing separate debuginfos, ...

  10. Erlang入门(三)——分布式编程

    明天要回家一个星期了,好好休息下.今天找到别人翻译的Erlang编程手册,值的好好读一遍.    所谓分布式的Erlang应用是运行在一系列Erlang节点组成的网络之上.这样的系统的性质与单一节点上 ...