3

We have been doing some prototype work involving Lightning, Angular and AuraNG and we have a few questions.

Currently aurang:region initialises an angular module and makes it available via the configure event. However there is no way to specify what dependencies you need added to the module at creation. Is it worth modifying the aurang:region to take an array of strings specifying the dependencies. e.g.

<aurang:region configure={!c...} dependencies="ngRoute, ngCookies, ngTouch ....">
    .......
</aurang:region>

It would also need to load the associated angular files, perhaps aurang:region could incorporate the aura:requires demo component that ye published before ? As an aside we know that using ngRoute will probably cause us pain down the road.

There is a related query here as to whether it's worth extending aurang:region to support an attribute indicating the name of a module to use, as opposed to having every region simply going into the same underlying module.

The second query we have is whether it might be possible to have the aura component compiler allow script blocks which have non javascript types. The reason we ask is that Angular allows us to inline template definitions in script blocks with type="text/ng-template". This would avoid them having to be coded into the controller. In our case it would facilitate us generating components the way we do pages today.

The third query relates to marshalling restrictions related to return types from Apex controllers. We created a custom apex class and attempted to return an instance of this from the controller. However the return value on the client side was an empty object. We hacked around it by serialising the return type as a string ourselves. Is this deliberate, a bug or even more likely am I being stupid ?

2 Answers 2

6

On the Apex marshaling question did you annotate the properties/getters with @AuraEnabled?

1
  • D'oh. Yes this was all me. I had @AuraEnabled the methods on the Apex Controller method but I had not added it to the members of the return type. Once i added them as appropriate, it worked as I would have hoped. I was following some old JSRemoting patterns. Hopefully this means we can reuse a bunch of our old JSRemoting endpoints / classes once we do some appropriate annotation. Thanks !
    – user4116
    Dec 2, 2014 at 16:35
2

Working my way through the list - first change is I added a new component, aurang:template, that transforms its body into an Angular inline template and interns it into Angular's $templateCache. I've also adjusted the demo code to use aurang:template (see https://github.com/forcedotcom/aura-ng/blob/master/metadata/aura/regionDemo/regionDemoComponent.cmp). A new version of the Force.com package has also been uploaded to AppExchange.

1
  • Thats cool and sounds safer than even opening the door to script tags. We'll grab that and have a play with it. Thanks
    – user4116
    Dec 2, 2014 at 16:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .