流星投掷无法找到HTML页面的模块

问题描述 投票:0回答:1

我是流星的新手。当我尝试导入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)
javascript meteor
1个回答
0
投票

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

那么,你的html导入将如下所示:

import './fnol.html';
© www.soinside.com 2019 - 2024. All rights reserved.