john.c.cartwright

creating AMD module using ArcGIS classes

Discussion created by john.c.cartwright on Jul 13, 2012
Hello All,

I'm having problems creating a simple AMD-widget using the "esri/tasks/identify" module.

Given a module that looks like:

define(["dojo/_base/declare", "dijit/_WidgetBase", "dijit/_TemplatedMixin", "esri/tasks/identify", "dojo/text!./templates/MyDijit.html"],
 function(declare, _WidgetBase, _TemplatedMixin, identify, template ){
  return declare([_WidgetBase, _TemplatedMixin], {
   templateString: template,

   constructor: function() {
   }

 });
});


and loading it like:

require(["ngdc/MyDijit"], function(MyDijit){
 var myDijit = new MyDijit();
});


I get the error "Uncaught TypeError: Cannot read property 'defaults' of undefined". This only occurs once I add in the
identify module.

Can someone please point out what I'm doing wrong?

Thanks!

--john

Outcomes