流星抛出无法找到HTML页面的模块

时间:2019-04-26 06:38:19

标签: javascript meteor

我是流星的新手。当我尝试导入HTML页面时,它在终端中向我显示错误,说明了这一点。

  

无法解析某些模块:

     

“ fnoldetail.html”

JS如下所示

import angular from 'angular';
import angularMeteor from 'angular-meteor';
import template from './fnol.html';
import navCtrl from '../navigation/navigation';
import {Claims} from '../../startup/collection.js';
import uiRouter from 'angular-ui-router';

const name="fnolList";

class FnolListCtrl {
  constructor($scope) {
    $scope.viewModel(this);

    this.helpers({
      fnols() {
        return Claims.find({status:'new'});
      }
    })
  }
}

export default angular.module(name, [
  angularMeteor,
  uiRouter,
  navCtrl.name
])
.component(name, {
  templateUrl: 'imports/components/fnol/fnol.html',
  controller: ['$scope', FnolListCtrl]
})
.config(config);

function config($stateProvider) {
  'ngInject';
  $stateProvider
  .state('fnol',{
    url:'/fnol',
    template:'<fnol-list></fnol-list>'
  })
}

在控制台中,它显示了这一点。

modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:232 Uncaught Error: Cannot find module './fnol.html'
at makeMissingError (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:232)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:251)
at Module.moduleLink [as link] (modules.js?hash=373f4b446711c9806553a5aac9a6ac92aa182748:299)
at fnol.js (fnol.js:1)
at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
at Module.moduleLink [as link] (modules.js?hash=373f4b446711c9806553a5aac9a6ac92aa182748:299)
at main.js (main.js:1)
at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)

1 个答案:

答案 0 :(得分:0)

Here是有关在流星中导入文件的文档。

因此,您的html导入将如下所示:

import './fnol.html';