app/templates/components/viewManager.js
function(className, viewArgs) {
            var self = this,
                view = this.views[className],
                dfd = $.Deferred();

            if (view) {
                view.undelegateEvents();
            }

            this.loader.load(className)
                .then(function(Constructor) {
                    viewArgs.manager = self;
                    view = new Constructor(viewArgs);
                    self.views[className] = view;
                    dfd.resolve(view);
                });

            return dfd.promise();
        }
function(className, viewArgs) {
            var self = this,
                view = this.views[className],
                dfd = $.Deferred();

            if (view) {
                view.undelegateEvents();
            }

            this.loader.load(className)
                .then(function(Constructor) {
                    viewArgs.manager = self;
                    view = new Constructor(viewArgs);
                    self.views[className] = view;
                    dfd.resolve(view);
                });

            return dfd.promise();
        }
function ( className , viewArgs ) { var self = this , view = this . views [ className ] , dfd = $ . Deferred ( ) ; if ( view ) { view . undelegateEvents ( ) ; } this . loader . load ( className ) . then ( function ( Constructor ) { viewArgs . manager = self ; view = new Constructor ( viewArgs ) ; self . views [ className ] = view ; dfd . resolve ( view ) ; } ) ; return dfd . promise ( ) ; }
Creates a new view.
@param {string} className the view to create
@param {Object} viewArgs view options
Creates a new view .