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:
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.
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.com/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>