码迷,mamicode.com
首页 > 其他好文 > 详细

angular 知识汇总

时间:2016-04-19 22:55:15      阅读:412      评论:0      收藏:0      [点我收藏+]

标签:

页面跳转

  1. 跳到某页面 (不带参数, 单纯跳转)
ng-click="action.toPage(‘tab.home-recommend-topic-detail‘)"
<!-------------------- 话题精选 ----------------------->
        <section class="white_bg topics ">
            <header class="fix_container ">
                <div class="fix_top_left" id="topics_mark"><i class="icon-topic"></i></div>
                <ul id="topic_title" >
                    <li ng-repeat="topic in data.topics" class="font_16_14 black_title one_line_text" ng-click="action.toPage(‘tab.home-recommend-topic-detail‘)">
                        #{{topic}}#
                    </li>
                </ul>
                <button class="btn blue_text_btn fix_top_right" ng-click="">更多</button>
            </header>
        </section>

控制器的代码:

angular.module(‘MrTrustApp.controllers‘)
    .controller(‘HomeCtrl‘, function ($scope, $state, StateGo, $ionicPopover, $timeout) {
     
     // 跳到某页面 (不带参数, 单纯跳转)
        $scope.action.toPage =  function(state){
            StateGo.go(state);
        };
});

 

angular 知识汇总

标签:

原文地址:http://www.cnblogs.com/hu-clover/p/5410535.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!