如何将ngForce添加到我的角度应用程序

时间:2018-09-05 14:50:04

标签: angularjs salesforce npm-install

我正在尝试将销售人员与我的角度应用程序集成在一起。经过长时间的搜索,我得到了this link。因此,我可以使用Apache ant进行grunt部署,将静态资源部署到我的销售人员。现在我想将ngForce注入到我的Angular模块中。但是没有找到npm的地方像这样安装ngForce。
有人可以指导我将销售人员整合到我的有角度的应用程序中吗。

克隆存储库后,我像

一样将ngForce添加到了模块中
var app = angular.module('myAwesomeAngularOnSalesforceApp', ['ngForce']);

我收到如下控制台错误:

> Error: [$injector:modulerr] Failed to instantiate module ngForce due to:
Error: [$injector:modulerr] Failed to instantiate module ngForce.config due to:
Error: [$injector:nomod] Module 'ngForce.config' 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.5.11/$injector/nomod?p0=ngForce.config
    at http://localhost:3000/bower_components/angular/angular.js:68:12
    at http://localhost:3000/bower_components/angular/angular.js:2133:17
    at ensure (http://localhost:3000/bower_components/angular/angular.js:2057:38)
    at module (http://localhost:3000/bower_components/angular/angular.js:2131:14)
    at http://localhost:3000/bower_components/angular/angular.js:4669:22
    at forEach (http://localhost:3000/bower_components/angular/angular.js:325:20)
    at loadModules (http://localhost:3000/bower_components/angular/angular.js:4653:5)
    at http://localhost:3000/bower_components/angular/angular.js:4670:40
    at forEach (http://localhost:3000/bower_components/angular/angular.js:325:20)
    at loadModules (http://localhost:3000/bower_components/angular/angular.js:4653:5)
http://errors.angularjs.org/1.5.11/$injector/modulerr? 

我有类似

的ngForceConfig.page文件
`<apex:page showheader="false" sidebar="false" contenttype="text/javascript">
(function(angular){

    var sitePrefix = '{!$Site.Prefix}';
    if(sitePrefix === '') sitePrefix = '/apex';

    angular.module('ngForce.config', []).constant('ngForceConfig', {
        sessionId: '{!$Api.Session_ID}',
        sitePrefix: sitePrefix,
        resourceUrl: '' <!-- Put the path the static resource here, e.g. '{!URLFOR($Resource.bundle)}' -->
    });

})(angular);
</apex:page>`

如何将其添加到index.html中。它不是.js文件,而是页面文件

0 个答案:

没有答案