Exploring dynamic widgets

Just as you finish up, a last-minute request comes in. Wouldn't it be a great idea to recognize guests who have stayed with us several times? We can do that with a custom widget.

A widget can be considered an AngularJS directive. The Controller as notation is used to get away from the need to use the Angular $scope service for many actions. Unless changed, the controller is instantiated as the c variable and so acts as the main mechanism to manipulate and control data. Most scripts start with declaring var c = this; to easily bind the output of the client script to the DOM. If you use Angular scripts from elsewhere (which typically use $scope), keep this in mind. You can use $scope, but you need to inject it as a ...

Get ServiceNow: Building Powerful Workflows now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.