IONIC----02.ionicBackdrop

5894 단어 Ionicbackdrop

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no,width=device-width,height=device-height">

<script src="./lib/js/ionic.bundle.min.js">script>
<link rel="stylesheet" type="text/css" href="./lib/css/ionic.min.css">

<title>Ionictitle>
head>

<body ng-app="myApp" ng-controller="fristController">
    <ion-header-bar class="bar-positive">
        <h1 class="title">$ionicBackdroph1>
    ion-header-bar>

    <ion-content>
        <div class="ezpop has-header padding">
            <a class="button button-block button-calm" ng-click="retain();">retaina>
            <a class="button button-block button-calm" ng-click="release();">releasea>
        div>
    ion-content>

    <ion-footer-bar class="bar-positive">
        <h1 class="title">{{locks}}h1>
    ion-footer-bar>
body>
html>
<script>
angular.module("myApp",["ionic"])
.controller("fristController", function($scope, $ionicBackdrop, $timeout,$interval) {
    $scope.locks = 0;
    // 
    $scope.retain = function() {
        $ionicBackdrop.retain();
        $scope.locks++;
    };
    // 
    $scope.release = function() {
        $ionicBackdrop.release();
        $scope.locks > 0 ? $scope.locks-- : 0;
    };

    $interval(function(){
        if($scope.locks > 0){
            $ionicBackdrop.release();

             $scope.locks--;
        }

    },2000)
});
script>

GITHUB

좋은 웹페이지 즐겨찾기