Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cumulocity-hellowidget-plugin

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cumulocity-hellowidget-plugin - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

2

package.json
{
"name": "cumulocity-hellowidget-plugin",
"version": "2.2.1",
"version": "2.2.2",
"description": "A demo app for showcasing creation of a custom Cumulocity UI widget plugin",

@@ -5,0 +5,0 @@ "keywords": [

@@ -11,6 +11,5 @@ /**

.component('c8yHelloTextInput', {
template: '<input ng-model="vm.helloText">',
template: '<input ng-model="vm.config.helloText">',
bindings: {
device: '<',
helloText: '=',
config: '<',
},

@@ -23,2 +22,3 @@ controllerAs: 'vm',

const vm = this;
const defaultConfig = { helloText: '' };

@@ -33,18 +33,18 @@ _.assign(vm, {

function $onInit() {
console.log(vm.helloText);
_.defaults(vm.config, defaultConfig);
vm.helloText = vm.helloText || '';
console.log(vm.config.helloText);
}
function $onChanges({ device }) {
if (device) {
onDeviceChange();
function $onChanges({ config }) {
if (config) {
onConfigChange(vm.config);
}
}
function onDeviceChange() {
const { device } = vm;
function onConfigChange(config) {
const deviceId = _.get(config, 'device.id');
if (device) {
console.info('device id:', device.id);
if (deviceId) {
console.info('device id:', deviceId);
}

@@ -51,0 +51,0 @@ }

@@ -55,3 +55,3 @@ /**

const element = createComponent(
'<c8y-hello-text-input hello-text="config.helloText" />',
'<c8y-hello-text-input config="config" />',
{ config: { helloText } },

@@ -58,0 +58,0 @@ );

@@ -13,3 +13,3 @@ /**

bindings: {
text: '<',
config: '<',
},

@@ -28,5 +28,5 @@ controllerAs: 'vm',

function $onInit() {
vm.text = vm.text || 'hello, world';
vm.text = _.get(vm, 'config.helloText', 'hello, world');
}
}
}());

@@ -51,3 +51,3 @@ /**

// when
const controller = $componentController('c8yHelloWidget', undefined, { text: textBinding });
const controller = $componentController('c8yHelloWidget', undefined, { config: { helloText: textBinding } });
controller.$onInit();

@@ -54,0 +54,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc