examples/HTML StarterKit/lib/durandal/js/viewEngine.js
function(viewId) {
            var that = this;
            var requirePath = this.convertViewIdToRequirePath(viewId);

            return system.defer(function(dfd) {
                system.acquire(requirePath).then(function(markup) {
                    var element = that.processMarkup(markup);
                    element.setAttribute('data-view', viewId);
                    dfd.resolve(element);
                }).fail(function(err){
                        that.createFallbackView(viewId, requirePath, err).then(function(element){
                            element.setAttribute('data-view', viewId);
                            dfd.resolve(element);
                        });
                    });
            }).promise();
        }
function(viewId) {
            var that = this;
            var requirePath = this.convertViewIdToRequirePath(viewId);

            return system.defer(function(dfd) {
                system.acquire(requirePath).then(function(markup) {
                    var element = that.processMarkup(markup);
                    element.setAttribute('data-view', viewId);
                    dfd.resolve(element);
                }).fail(function(err){
                        that.createFallbackView(viewId, requirePath, err).then(function(element){
                            element.setAttribute('data-view', viewId);
                            dfd.resolve(element);
                        });
                    });
            }).promise();
        }
function ( viewId ) { var that = this ; var requirePath = this . convertViewIdToRequirePath ( viewId ) ; return system . defer ( function ( dfd ) { system . acquire ( requirePath ) . then ( function ( markup ) { var element = that . processMarkup ( markup ) ; element . setAttribute ( 'data-view' , viewId ) ; dfd . resolve ( element ) ; } ) . fail ( function ( err ) { that . createFallbackView ( viewId , requirePath , err ) . then ( function ( element ) { element . setAttribute ( 'data-view' , viewId ) ; dfd . resolve ( element ) ; } ) ; } ) ; } ) . promise ( ) ; }
Creates the view associated with the view id.
@method createView
@param {string} viewId The view id whose view should be created.
@return {Promise} A promise of the view.
Creates the view associated with the view id .