简体   繁体   English

无法使angular-timer指令运行

[英]Trouble getting angular-timer directive to run

http://siddii.github.io/angular-timer/examples.html#/angularjs-single-timer http://siddii.github.io/angular-timer/examples.html#/angularjs-single-timer

Trying to get a simple timer directive to work on a fitness app, the 3rd line 试图获得一个简单的计时器指令以在健身应用程序上工作,第三行

<ion-view view-title="Add/Edit Workout" ng-controller="WorkoutEditsCtrl">
    <ion-nav-buttons side="secondary">
     <h3><timer /></h3>

        <!-- <h1 class="title">{{workout.name}}</h1> -->

            <button class="button button-icon ion-compose"ng-click="addEx(); startTimer()"></button>

    </ion-nav-buttons>
    <ion-content>

It seems to have installed correctly in bower, in my index.html I have this line and it seems fine: 它似乎已正确安装在bower中,在我的index.html中,我有这行内容,看起来还不错:

<script src="lib/angular-timer/app//js/_timer.js"></script>

than in my controller file : 比我的控制器文件中:

var contollers = angular.module('CovalentFitness.controllers', ['timer'])

contollers.controller('WorkoutEditsCtrl', function($scope, $location, $ionicModal, WorkoutServices) {
  //Timer

  // $scope.timerRunning = true;

  // $scope.startTimer = function (){
  //     $scope.$broadcast('timer-start');
  //     $scope.timerRunning = true;
  // };

  // $scope.stopTimer = function (){
  //     $scope.$broadcast('timer-stop');
  //     $scope.timerRunning = false;
  // };

  // $scope.$on('timer-stopped', function (event, data){
  //     console.log('Timer Stopped - data = ', data);
  // });
})

this has worked before for previous directives I've installed... this is the error I get 这对于我已经安装的以前的指令之前有效...这是我得到的错误

Error: [$injector:unpr] Unknown provider: I18nServiceProvider <- I18nService

You're including the wrong file. 您输入的文件有误。 You should include the angular-timer.js file that's in the dist folder. 您应该在dist文件夹中包含angular-timer.js文件。

<script src="lib/angular-timer/dist/angular-timer.js"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM