Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Michael Paterson
    @mcgilly17
    ill do it now...
    Avi Haiat
    @thaiat
    and let me know how you progress
    Michael Paterson
    @mcgilly17
    will do, thanks again.
    Michael Paterson
    @mcgilly17
    Morning @thaiat, is it safe to customise the namespace for different targets? If so - would it be wise to create a conditional for different view templates in ui-router. (i had planned on moving out the route definitions from each module to the two main.js files but then i read about the namespace). Do you have any working examples of haveing two targets running side by side?
    Avi Haiat
    @thaiat
    not sure i see what you mean
    Avi Haiat
    @thaiat

    i would create a module for holding the routes:
    so let's say you have phone for the mobile routes, and browser for the web routes
    in mobile/index.js you can do:

    'use strict';
    var angular = require('angular');
    
    var modulename = 'mobile';
    module.exports = function(namespace) {
        var fullname = namespace + '.' + modulename;
        var deps = [...];
        var app = angular.module(fullname, deps);
        var common = require('../common') // the common module holding controllers and views
        app.namespace = app.namespace || {};
        app.namespace.common = common.name;
    
       // inject:folders start
        require('./constants')(app);
        require('./controllers')(app);
        require('./directives')(app);
        require('./services')(app);
        require('./values')(app);
        // inject:folders end
    
        app.config(['$stateProvider', '$urlRouterProvider',
            function($stateProvider, $urlRouterProvider) {
                $stateProvider
                     .state('login1',  {
                        url: '/login1',
                        template: require('../common/views/login1.html'), // using login1.html and common.login ctrl
                        controller: app.namespace.common + '.login as vm'
                    })
                  .state('login2', {
                        url: '/login2',
                        template: require('../common/views/login2.html'),  // using login2.html and common.login ctrl
                        controller: app.namespace.common + '.login as vm'
                    })
    }

    you could expand that example with multiple modules, it is easy to grab their namespace using app.namespace.<modulename>

    Michael Paterson
    @mcgilly17
    thanks @thaiat so best to create a module for mobile and a module for web that are required by their respective main-targetname.js. Each module then has access to the common module which has all common controllers.
    Avi Haiat
    @thaiat
    yeah, you can play around with those concepts and find a different approach but this one will work just fine
    Michael Paterson
    @mcgilly17
    excellent - thanks for getting me back on the straight and narrow.
    Johnny
    @nahoang
    hi everyone
    i have a problem with mcfly-generator
    Avi Haiat
    @thaiat
    Tell me
    Johnny
    @nahoang
    thank you for listen me
    i am newbie
    i have a app use generator-mcfly
    i use command 'gulp-dist'
    i can't find config.xml in dist folder
    i want to use command 'ionic'
    can you help me for this problem
    Avi Haiat
    @thaiat
    you need to
    scaffild a mobile app
    with The --mobile flag
    checkout The docs
    Johnny
    @nahoang
    yes i did
    so i've just saw 'www' folder
    i want to have 'config.xml' file
    because i want use 'cordova platform add android'
    Avi Haiat
    @thaiat
    i dont understand
    Johnny
    @nahoang
    I try with 'yo mcfly --mobile' and change to dist\app\dev
    i can not use ionic command
    because it's not have config.xml
    Johnny
    @nahoang
    i found my problem
    because it can not find module cordova
    johnnyauto
    @johnnyauto
    is there anybody here?
    i have problem with generator
    can you help me?
    Avi Haiat
    @thaiat
    sure what is it ?
    Joel Bowen
    @joelbowen
    I'm having a problem running tests in my app, I'm getting TypeError: 'undefined' is not a function (evaluating 'app.controller(fullname, controller)') from PhantomJS and karma. I'm also getting Missing error handler onsocket. TypeError: sockets.forEach is not a function I did start nesting my controllers in folders (controllers/folder/controller.js) any ideas / help?
    Avi Haiat
    @thaiat
    what do you mean by nesting controller ?
    johnnyauto
    @johnnyauto
    hi @thaiat
    Avi Haiat
    @thaiat
    hi
    johnnyauto
    @johnnyauto
    i've used generator in my project
    i don't know use other library in it
    i've build mobile app use ionic framework
    for example calendar library
    how to use it in my app?
    Joel Bowen
    @joelbowen
    @thaiat just that while the generator normally does controllers/name.controller.js I'm doing controllers/feature/name.controller.js I don't think that's an issue... I just had to manually rewrite the require statements. But when karma runs it's not getting app for my controllers.
    Joel Bowen
    @joelbowen

    Alright - my solutions have been multiple however here's the rundown: Biggest one was updating Karma because a socket.io version change had knocked it out karma-runner/karma#1782. Karma should be >0.13.19.

    Additionally, a small format issue in gulp_tasks/tasks/test.js was throwing additional errors. (See this SO issue)

    Joel Bowen
    @joelbowen
    I also needed to update phantomJS and karma-phantomjs-launcher (which requires phantom-js-prebuilt) angular/angular.js#13794
    Punita Ojha
    @punitaojha
    This message was deleted