Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Call controller after page loaded

$
0
0
Hi  all,
i have to do a little example with JMVC.
I try to do a really simple contact site, but I'm not able to initialize my controller.
I get following message

TypeError: contacts is not a constructor
there are my steal part


steal(
    './css/contacts.css'
    )
    .then(
    '../jquery/class/class.js',
    '../jquery/controller/controller.js',
    '../jquery/view/ejs/ejs.js',
    '../jquery/controller/view/view.js',
    '../jquery/controller/subscribe/subscribe.js',
    '../jquery/model/model.js',
    '../jquery/dom/fixture/fixture.js')
    .then(
    '../bootstrap/css/bootstrap.css',
    '../bootstrap/js/bootstrap.min.js'
    )
    .then(
    './application/contacts.js'
    )
    .then(
        function(){
            $(document).ready(function(){
                var instance = new contacts($('#content'));
            });
        }
    )
And my Controller

$.Controller('Contacts',
    /** @Static */
    {
        defaults : {
        },
        pluginName: 'contacts'
    },
    /** @Prototype */
    {
   
        /**
         * called by class init
         * @function init
         *
         */
        init : function(element) {
            console.log('test');
           
        }
    }
); // End of controller


Maybe anybody can give me a hint what I'm doing wrong.
Cheers
Sebtra



Viewing all articles
Browse latest Browse all 3491

Trending Articles