I've watched the youtube tutorial a number of times and also tried to use the default json feed at "/widget_notificaiton/demodata/default" and I always get the following in my navigation bar "{{response.badge_text}}". See the attached images.

screenshot

screenshot2

As you can see I'm using the PM Kickstart Theme (7.x-1.x-dev).

When I navigate to both the default demodata feed and my own that I have created I can see the feeds are there:

/widget_notificaiton/demodata/default:

{"badge_text":10,"badge_type":"alert-danger","fa_icon":"fa-envelope","detail_url":"\/","detail_url_text":"Read all messages","messages":[{"title":"John Doe","fa_icon":"fa-comment","text":"Hi there, i think you would be interested in this cool new feature","path":"\/examples\/twitter","text_muted":"10:01:04","showProgress":true,"progress_percent":6.6666666666667,"progress_type":"warning"},{"title":"Jane Roe","subtitle":"(project lead)","text":"The design files have been updated, need your approval","path":"\/examples\/twitter","text_muted":"09:01:04","showProgress":false},{"subtitle":"Twitter","path":"\/examples\/twitter","text_muted":"Yesterday","fa_icon":"fa-twitter"},{"subtitle":"System","path":"\/admin\/reports\/log","text_muted":"Yesterday","badge_text":17,"badge_type":"progress-bar-danger","fa_icon":"fa-gear"},{"subtitle":"Facebook","text":"Some really long text definitely exceding 200 character count to\n show that the text is indeed truncated by using ng directive LimitTo.","path":"\/examples\/facebook","text_muted":"Today","fa_icon":"fa-facebook"}]}

I'd really like to get this working. Are there undocumented dependencies? What am I missing?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

johnkareoke created an issue. See original summary.

johnkareoke’s picture

I've managed to debug this a little further. It seems the angular.js functions are not loading. When I inspect the JS console I get the following error:

Uncaught ReferenceError: angular is not defined

@

angular.module('demoblock', ['ngResource', 'emguo.poller'])
.controller('demoblockCtrl', function($scope, $resource, poller) {
  var messageResource = $resource("test/feeds");
  var messagePoller = poller.get(messageResource,{
      }
  );

Any assistance would be much appreciated

D34dMan’s picture

Is this on your local or somewhere i can access?

johnkareoke’s picture

It can be accessed here: http://dev-widgettest.pantheon.io

D34dMan’s picture

did you install jquery update and can you tell me what jquery version you are using?

johnkareoke’s picture

I have installed Jquery update: It is running V1.10 (Development) from Google CDN:

screenshot

D34dMan’s picture

Following js libraries are needed.
angular-poller.js from https://github.com/emmaguo/angular-poller/ and angular.js and angular-resource.js from http://code.angularjs.org/

put them in libraries folder so that it looks something like below

sites/all/libraries/angular-poller/angular-poller.js
sites/all/libraries/angular-resource/angular-resource.js
sites/all/libraries/angular/angular.js

I will improve the documentation regarding this.

johnkareoke’s picture

Thanks D34dMan. I've got it working, with one minor change to the libraries above, which is worth noting for the readme

sites/all/libraries/angular-poller/angular-poller.js
sites/all/libraries/angular/angular-resource.js
sites/all/libraries/angular/angular.js

and not

sites/all/libraries/angular-poller/angular-poller.js
sites/all/libraries/angular-resource/angular-resource.js
sites/all/libraries/angular/angular.js
johnkareoke’s picture

Component: Code » Documentation
Status: Active » Fixed
D34dMan’s picture

Assigned: Unassigned » D34dMan
Category: Bug report » Task
Status: Fixed » Needs work

@johnkareoke thanks a lot :) sorry for the inconvenience caused.

Assigning this to myself as Documentation has to be updated.

  • D34dMan committed a740d0e on 7.x-2.x
    Issue #2623414 by johnkareoke : Widget Notifications messages: doesn't...
D34dMan’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Status: Needs work » Closed (fixed)

Thanks, updated readme and documentation on project homepage