The CreatorCon Call for Content is officially open! Get started here.

Karen Lazarenko
ServiceNow Employee
ServiceNow Employee

Please post comments and questions via the Comment link below.

Comments
conanlloyd
Giga Guru

You actually finally use it, and get a bit more info, in lab 3.2. Specifically on page 146.

OliverDoesereck
Tera Guru

The music from yesterday was fine. And the Australian Psychedelic sounds great 😉

goulart
Tera Contributor

What exactly is table sp_instance for ? What is recorded there ?

goulart
Tera Contributor

What about some brazilian music ? Anavitoria or Maria Gadu should be great

ben_hollifield
Tera Guru

sp_instance (and it's extended tables) are just tables where widget options are stored. You can add additional options for a widget by customizing an sp_instance-extended table (like we did in the lab), or by creating those options via the widget editor. The difference is that the former has more robust capabilities around field types, field dependencies, etc. However, the latter is simpler. Generally, we'll use the latter (adding options via that widget editor) unless your use-case demands the extended capabilities of a new sp_instance table.

Dan Conroy
ServiceNow Employee
ServiceNow Employee

The top answer on this post is a good read on the difference between link and controller functions: https://stackoverflow.com/questions/15676614/link-vs-compile-vs-controller

Does anyone else have any good resources or opinions on it they would like to share?

OliverDoesereck
Tera Guru

I enjoy jQuery for all of its great advantages but I keep getting told to use as little as possible, especially when using Angular. Considering Angular also uses jqLight, I guess we can also use it in moderation.

 

Lab 3.4 makes me a little sad though, using Link/DOM Manipulation vs a simple ng-class to add/remove the highlight class:
ng-class="{'highlight':c.data.selectedAg == s.agValue}"
Any specifics about performance between the two different methods?

Dave L
Tera Contributor

MomentJS is also available on the client side if you need to do any DateTime manipulation.

caroleanderson
ServiceNow Employee
ServiceNow Employee

Posted for an attendee -

In Lab 3.4, we are using the link function to create a help link. What is the benefit of using this approach vs. an ng-click?

ben_hollifield
Tera Guru

We generally agree. The lab shows the concept of using a link function. However, we wouldn't use link for something that could more easily be applied using built-in directives. In addition, link functions contain a number of helper vars & attributes that alleviate the need to use jquery $ notation for many functions. For folks who like the concept of the link function and see use-cases, we'd highly recommend looking deeper into angular best-practices for using link.

As far as performance goes, there isn't an impact if you are writing 'good' jquery. The beauty of angular is that it adds helper functions that, under the covers, are running the leanest version of the jquery functionality. By writing your own, you risk writing less efficient code. Like most things in ServiceNow, you can bypass the helpers and shoot yourself in the foot, performance-wise, if you choose to. 🙂

ben_hollifield
Tera Guru

No benefit. It's just an example to illustrate usage of a link function. In this case, ng-click probably would be the right move!

Dan Conroy
ServiceNow Employee
ServiceNow Employee

An example of how we could use some directives instead of DOM manipulation on the link function in Lab 3.4.

Using ng-click and ng-class.

Dan Conroy
ServiceNow Employee
ServiceNow Employee

Yes, we can definitely use a combination of ng-click and ng-class for this rather than the link function - see my post below!

Elizabeth Turne
Giga Contributor

can we continue the Aussie psych rock, add in some Silverchair and continue playing Radiohead, perhaps with some Flaming Lips, Nels Cline Trio, the Cush, or Broadcast thrown in? 

 

 

caroleanderson
ServiceNow Employee
ServiceNow Employee

If you are interested in learning more about AngularJS scopes, you may want to peruse this article in the ServiceNow community. 

caroleanderson
ServiceNow Employee
ServiceNow Employee

FYI - there is a typo in the book on p. 199, step e and step g - UI Script should be Style Sheet.

conanlloyd
Giga Guru

Hey Dan, any chance you could post the code snippets?  Can't always get the screenshots to show up well.

Dan Conroy
ServiceNow Employee
ServiceNow Employee

Lab 4.3 uses a link function in the spTimeAgo directive you create.


Another way is to use a controller function and the “controller as” syntax we are familiar with using in widgets:

find_real_file.png

 

felladin
Tera Guru

If you missed the link to the widget collection: servicenowinnovation.com

ben_hollifield
Tera Guru

Can any staff confirm whether this Community thread will be here in perpetuity? Or, will it expire after a certain time?

OliverDoesereck
Tera Guru

Just a headsup if you are going to use this example:

Make sure to also update your line 33 (c.date instead of date and c.ago instead of ago)

ben_hollifield
Tera Guru
jorgegrc
Tera Contributor

Not sure if anybody will read this but I have to try: I'm trying to upload the generated update sets from the labs on the course to a developer instance, but I'm missing the application 'CloudDimensions' which I assume it was installed in all the training instances (via Update Set??). Does anybody still have this update set? I cannot commit to a dev instance my completed work on the training because I didn't realize in time and didn't download this from the training instance

jorgegrc
Tera Contributor

I found everything here: http://sp.ht4.org/. I didn't expect the link to be still available but it is actually 🙂

emyrold
Giga Expert

I saved everything off... PM me and I can send it to you if you still want it.

jorgegrc
Tera Contributor

Thanks a lot! But I already found all class materials in the link I posted above :). Good thing they still were available

Version history
Last update:
‎04-12-2018 10:44 AM
Updated by: