Angular web page breaks when I try to access it from the local/html directory of RT 4.4.2

Hello.

I have a page that works if I am logged into rT and run it from my local public_html directory. It uses RT 4.4.2, the REST API and Angular.js.

https:///~keith/rt-progress.htmlhttps://<myserver>/~keith/rt-progress.html

If I try to run it using a URI like

https:///rt/rt-progress.htmlhttps://<myserver>/rt/rt-progress.html

I get an error, "Illegal character in rt-progress.js at line 173:16. The character there is just a comma and belongs there. In any case it’s exactly the same script just accessed from a different html directory.

We have a similar script, that doesn’t use angular.js, that works.

Any idea if RT is simply not compatible with Angular.js markup?

Is there any hope of updating RT to be more REST and json compliant as well as making it so it doesn’t try to mangle scripts?

Keith

Hello.

Hi Keith,

We have a similar script, that doesn’t use angular.js, that works.

Any idea if RT is simply not compatible with Angular.js markup?

I’ve done some prototyping with Angular (1.x) within RT’s UI and I don’t recall having any particular problems.

Is there any hope of updating RT to be more REST and json compliant as well as making it so
it doesn’t try to mangle scripts?

We are eager to release a new REST API with JSON support, but as of right now it’s still in the works.

RT certainly shouldn’t be mangling scripts in any case!

Keith

Thanks,
Shawn

Thanks Shawn. It is good to know at least that this could work. My problem is that the error I’m getting in the web-development console is pretty useless. It may be difficult to figure out just what’s going wrong when I try to access it from the local/html directory in RT.

I am including the script like this, <script src="https://tech.aph.org/~keith/rt-progress.js. Obviously RT should not be touching this.

As I mentioned before, we have a similar page that includes a script in just the same way that works. The new angular.js version fails.

Another possible resolution would be if I can catch the “Not logged in” message and then call RT to let the user log in and use my page as the “tangent”. I don’t know how to do that or even if there is a way.

Thanks.

KeithFrom: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Shawn Moore
Sent: Wednesday, May 11, 2016 3:40 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Angular web page breaks when I try to access it from the local/html directory of RT 4.4.2

Hello.

Hi Keith,

We have a similar script, that doesn’t use angular.js, that works.

Any idea if RT is simply not compatible with Angular.js markup?

I’ve done some prototyping with Angular (1.x) within RT’s UI and I don’t recall having any particular problems.

Is there any hope of updating RT to be more REST and json compliant as
well as making it so it doesn’t try to mangle scripts?

We are eager to release a new REST API with JSON support, but as of right now it’s still in the works.

RT certainly shouldn’t be mangling scripts in any case!

Keith

Thanks,
Shawn
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training

  • Washington DC - May 23 & 24, 2016

Hi. I’m still stumped. Here is a function that fails. It’s in the angular controller. It works if the page that includes it is outside RT but failes when within RT… I commented out everything but the essential code.

function getTableData(data) {
console.log(data);
// var tickets = rt.parseForNumbers(data);
var tickets = {1: ‘ticket/1’};
// line 174…
angular.forEach (tickets, function (value, key) {
console.log(key+", "+value);
});
}

The error is-

SyntaxError: illegal character
rt-progress.js:174:25

It is the comma ‘,’ in line 174.

Does anyone have any clues?

Thanks.

KeithFrom: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Keith Creasy
Sent: Wednesday, May 11, 2016 4:30 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Angular web page breaks when I try to access it from the local/html directory of RT 4.4.2

Thanks Shawn. It is good to know at least that this could work. My problem is that the error I’m getting in the web-development console is pretty useless. It may be difficult to figure out just what’s going wrong when I try to access it from the local/html directory in RT.

I am including the script like this, <script src="https://tech.aph.org/~keith/rt-progress.js. Obviously RT should not be touching this.

As I mentioned before, we have a similar page that includes a script in just the same way that works. The new angular.js version fails.

Another possible resolution would be if I can catch the “Not logged in” message and then call RT to let the user log in and use my page as the “tangent”. I don’t know how to do that or even if there is a way.

Thanks.

Keith

From: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Shawn Moore
Sent: Wednesday, May 11, 2016 3:40 PM
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Angular web page breaks when I try to access it from the local/html directory of RT 4.4.2

Hello.

Hi Keith,

We have a similar script, that doesn’t use angular.js, that works.

Any idea if RT is simply not compatible with Angular.js markup?

I’ve done some prototyping with Angular (1.x) within RT’s UI and I don’t recall having any particular problems.

Is there any hope of updating RT to be more REST and json compliant as
well as making it so it doesn’t try to mangle scripts?

We are eager to release a new REST API with JSON support, but as of right now it’s still in the works.

RT certainly shouldn’t be mangling scripts in any case!

Keith

Thanks,
Shawn
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training