小编jos*_*ose的帖子

地理位置在设备ionic3中不起作用

我正在与ionic 3基于位置的工作。我无法在此处获取当前的纬度和经度位置。我提到了我的可用代码。在浏览器级别上可以正常工作,但不能在移动设备上工作。

$ ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"
$ npm install --save @ionic-native/geolocation
Run Code Online (Sandbox Code Playgroud)
$ ionic cordova plugin add cordova-plugin-geolocation --variable GEOLOCATION_USAGE_DESCRIPTION="To locate you"
$ npm install --save @ionic-native/geolocation
Run Code Online (Sandbox Code Playgroud)

geolocation hybrid-mobile-app ionic-framework ionic2 ionic3

7
推荐指数
1
解决办法
5908
查看次数

如何读取AngularJS中的特定列范围行数

我正在使用AngularJS中的excel导入功能.现在通过阅读excel值可以正常工作.但我需要读取一个特定的列范围行计数,我附上了我尝试过的代码和预期的输出.在这里我得到行计数为7但我需要名称和主题列行计数只有预期的行数为4有助于如何解决这个问题.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Angular Js XLS</title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>
        <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.9.13/xlsx.full.min.js"></script>
        <script type="text/javascript" src="https://unpkg.com/angular-js-xlsx@0.0.3/angular-js-xlsx.js"></script>
    </head>

    <body ng-app="MyApp">

        <div ng-controller="myController">
            <js-xls onread="read" onerror="error"></js-xls>
            <!-- <input type="file" ng-change="read" onerror="error"> -->
        </div>

    </body>

    <script type="text/javascript">
        angular.module('MyApp', ['angular-js-xlsx'])
        .controller('myController', function($scope) {
            $scope.read = function (workbook) {
debugger;
                var headerNames = XLSX.utils.sheet_to_json( workbook.Sheets[workbook.SheetNames[0]], { header: 1 })[0];
                var data = XLSX.utils.sheet_to_json( workbook.Sheets[workbook.SheetNames[0]]);

                console.log(headerNames);
                console.log(data);

                for (var row in data)
                {
                    Object.keys(data[row]).forEach(function(key) {
                        console.log("Key = >" + key);
                        console.log("Value => …
Run Code Online (Sandbox Code Playgroud)

javascript excel angularjs

5
推荐指数
0
解决办法
711
查看次数

如何使用angularjs基于paritcular值拼接数组

我正在使用angularjs,我在范围内有一个数组.我需要删除No=1范围内有大量数据的对象.我需要删除特定值称为'1'.

请帮助如何实现这一目标.

    var data=[
      {
         "No":1,
        "PatientState": "AK",
        "DispenseMonth": "7/1/2016" 

      },
      {
        "No":2,
        "PatientState": "AK",
        "DispenseMonth": "8/1/2016" 
      },
      {
         "No":1,
        "PatientState": "AK",
        "DispenseMonth": "9/1/2016" 
      },
      {
        "No":1,
        "PatientState": "AK",
        "DispenseMonth": "10/1/2016" 
      },
      {
        "No":4,
        "PatientState": "AK",
        "DispenseMonth": "11/1/2016" 
      },
      {
        "No":1,
        "PatientState": "AK",
        "DispenseMonth": "2/1/2017" 
      },
      {
         "No":5,
        "PatientState": "AK",
        "DispenseMonth": "3/1/2017" 
      }
        ]

        $scope.StateInformations =data;
Run Code Online (Sandbox Code Playgroud)

javascript arrays angularjs

1
推荐指数
1
解决办法
246
查看次数