最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Importing Angular library into Lotus Domino db - Stack Overflow

programmeradmin0浏览0评论

I'm experimenting with using Angular and so am looking to import the standard library angular.min.js into a Domino database with Domino designer.

However when I do this, I get zillions of javascript errors in the imported file. I have tried:

  • Pasting in as a javascript script library
  • Importing directly as a Resource file
  • Importing as WebContent via Package Explorer.

The version of angular.min.js I am using is straight from the Angular website, and works just fine if included in a locally run html file.

The symptoms are that firstly including the file doesn't work (generates script errors in browser) and if I look at the resource / script lib etc I see loads of red markers for syntax errors.

The odd part is that the same method(s) to include jquery seem to work fine.

Has anyone else managed this? Surely they must have.. I bet I'm doing something impressivley stupid

In case it's relevant, this is eventually for use in an xpage.

I'm experimenting with using Angular and so am looking to import the standard library angular.min.js into a Domino database with Domino designer.

However when I do this, I get zillions of javascript errors in the imported file. I have tried:

  • Pasting in as a javascript script library
  • Importing directly as a Resource file
  • Importing as WebContent via Package Explorer.

The version of angular.min.js I am using is straight from the Angular website, and works just fine if included in a locally run html file.

The symptoms are that firstly including the file doesn't work (generates script errors in browser) and if I look at the resource / script lib etc I see loads of red markers for syntax errors.

The odd part is that the same method(s) to include jquery seem to work fine.

Has anyone else managed this? Surely they must have.. I bet I'm doing something impressivley stupid

In case it's relevant, this is eventually for use in an xpage.

Share Improve this question edited Sep 23, 2015 at 15:41 user2808054 asked Sep 23, 2015 at 15:17 user2808054user2808054 1,3861 gold badge11 silver badges20 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 10

First: forget about opening the Angular JS file in Designer. It will throw errors because it uses JavaScript syntax that isn't supported by the built-in editor. The file is (probably) just fine.

Next, I'm not sure where you're loading the file exactly, but if you want to do it in an XPage: here's a simple example I just created and that works:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view
    xmlns:xp="http://www.ibm./xsp/core">
    <xp:this.attrs>
      <xp:attr
        name="ng-app"
        value="myApp">
     </xp:attr>
    </xp:this.attrs>

<xp:this.resources>
    <xp:script
        src="angular/angular.min.js"
        clientSide="true">
    </xp:script>
</xp:this.resources>

<div ng-controller="MyController">
    {{hello}} this
</div>

<xp:scriptBlock
    id="scriptBlock1">
    <xp:this.value><![CDATA[var app = angular.module('myApp', []);

app.controller('MyController', function($scope) {

  $scope.hello = 'world';

});
]]></xp:this.value>
</xp:scriptBlock>

</xp:view>

Here are some interesting links for starting with angular and domino:

http://hasselba.ch/blog/?p=1458

http://hasselba.ch/blog/?p=1485

http://hasselba.ch/blog/?p=1525

http://hasselba.ch/blog/?cat=50

http://xomino./2014/06/01/angular-js-in-xpages-6-a-people-manager-crud-application/

I hope this helps...

发布评论

评论列表(0)

  1. 暂无评论