2017-08-25 29 views
0

發現當我運行我的應用程序它訥韋爾發現suggestions.module altough它加載AM-建議-lib.js 我不知道我做錯了模塊的建議。我正在使用angular 1.6和browserify。 我發佈的所有是有用的文件。不能在我的應用程序的角度用1.6 browserify

this is the tree view

suggestion.module.js

import {suggestionsComponent} from './suggestions.component'; 
    import {suggestionComponent} from './suggestion/suggestion.component'; 
    import {suggestionActionComponent} from './suggestion/suggestion-action/suggestion-action.component'; 
    import {suggestionViewerComponent} from './suggestion/suggestion-viewer/suggestion-viewer.component'; 

    export const suggestions = 
     angular.module('suggestions') 
     .component('suggestions', suggestionsComponent) 
     .component('suggestionComponent', suggestionComponent) 
     .component('suggestionActionComponent', suggestionActionComponent) 
     .component('suggestionViewerComponent', suggestionViewerComponent); 

root.module.js

import {suggestions} from './suggestions/suggestions.module'; 
import {commons} from './commons/commons.module'; 
import {rootComponent} from './root.component'; 
import {templates} from './root.templates'; 

export const app = 
    angular 
    .module('app', ['templates', 'suggestions', 'commons']) 
    .component('rootComponent', rootComponent); 

日誌我得到了Chrome瀏覽器開發工具,當我跑我的應用程序

am-suggestions-lib.js:116 Uncaught Error: [$injector:nomod] Module 'suggestions' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument. 
http://errors.angularjs.org/1.6.6/$injector/nomod?p0=suggestions 
    at am-suggestions-lib.js:116 
    at am-suggestions-lib.js:2297 
    at ensure (am-suggestions-lib.js:2218) 
    at Object.module (am-suggestions-lib.js:2295) 
    at Object.9../suggestion/suggestion-action/suggestion-action.component (suggestions.module.js:7) 
    at s (_prelude.js:1) 
    at _prelude.js:1 
    at Object.3../commons/commons.module (root.module.js:1) 
    at s (_prelude.js:1) 
    at e (_prelude.js:1) 

AM-建議,lib.js

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var commons = exports.commons = angular.module('commons'); 

    },{}],2:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var rootComponent = exports.rootComponent = { 
     templateUrl: 'root.html' 
    }; 

    },{}],3:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    exports.app = undefined; 

    var _suggestions = require('./suggestions/suggestions.module'); 

    var _commons = require('./commons/commons.module'); 

    var _root = require('./root.component'); 

    var _root2 = require('./root.templates'); 

    var app = exports.app = angular.module('app', ['templates', 'suggestions', 'commons']).component('rootComponent', _root.rootComponent); 

    },{"./commons/commons.module":1,"./root.component":2,"./root.templates":4,"./suggestions/suggestions.module":9}],4:[function(require,module,exports){ 
    "use strict"; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var templates = exports.templates = angular.module("root.templates", []).run(["$templateCache", function ($templateCache) { 
     $templateCache.put('suggestions/suggestions.html', '<h1>soy root<suggestion></suggestion></h1>'); 
     $templateCache.put('suggestions/suggestion/suggestion.html', '<h1>soy suggestion<suggestion-viewer></suggestion-viewer><suggestion-action></suggestion-action></h1>'); 
     $templateCache.put('suggestions/suggestion/suggestion-action/suggestion-action.html', '<div id="suggestion-action"><h1>soy suggestion-action</h1></div>'); 
     $templateCache.put('suggestions/suggestion/suggestion-viewer/suggestion-viewer.html', '<div id="suggestion-viewer"><h1> Hola soy Suggestions Viewer</h1></div>'); 
    }]).name; 

    },{}],5:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var suggestionActionComponent = exports.suggestionActionComponent = { 
     templateUrl: 'suggestions/suggestion/suggestion-action/suggestion-action.html' 
    }; 

    },{}],6:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var suggestionViewerComponent = exports.suggestionViewerComponent = { 
     templateUrl: 'suggestions/suggestion/suggestion-viewer/suggestion-viewer.html' 
    }; 

    },{}],7:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var suggestionComponent = exports.suggestionComponent = { 
     templateUrl: './suggestions/suggestion/suggestion.html' 
    }; 

    },{}],8:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    var suggestionsComponent = exports.suggestionsComponent = { 
     bindings: {}, 
     templateUrl: 'suggestions/suggestions.html' 
    }; 

    },{}],9:[function(require,module,exports){ 
    'use strict'; 

    Object.defineProperty(exports, "__esModule", { 
     value: true 
    }); 
    exports.suggestions = undefined; 

    var _suggestions = require('./suggestions.component'); 

    var _suggestion = require('./suggestion/suggestion.component'); 

    var _suggestionAction = require('./suggestion/suggestion-action/suggestion-action.component'); 

    var _suggestionViewer = require('./suggestion/suggestion-viewer/suggestion-viewer.component'); 

    var suggestions = exports.suggestions = angular.module('suggestions').component('suggestions', _suggestions.suggestionsComponent).component('suggestionComponent', _suggestion.suggestionComponent).component('suggestionActionComponent', _suggestionAction.suggestionActionComponent).component('suggestionViewerComponent', _suggestionViewer.suggestionViewerComponent); 

    },{"./suggestion/suggestion-action/suggestion-action.component":5,"./suggestion/suggestion-viewer/suggestion-viewer.component":6,"./suggestion/suggestion.component":7,"./suggestions.component":8}]},{},[3]) 


    //# sourceMappingURL=am-suggestions.js.map 

回答

0

問題是我沒有把[]在模塊中。 angular.module( '建議',[]); Altough這是固定的我不能看到我的玉工作的看法

相關問題