title: Angular 2 using ng require versus import
body: <p>Am from the Angular 1 world going into Angular 2 and trying to better understand options with Angular 2's routing. Found a decent tutorial and they are using at import like:</p>
  
  <pre><code>import { ModuleWithProviders }  from '@angular/core';
  import { Routes, RouterModule } from '@angular/router';
  </code></pre>
  
  <p>within the routes.js (though the tutorial is using typescript (.ts) of which I am not).</p>
  
  <p>That said, if I strictly just try using the import rather than what I had initially of (note: mine does not show the @angular/router yet within the routes.js file):</p>
  
  <pre><code>var ng = require('@angular/core');
  </code></pre>
  
  <p>So I like the premise of what they are doing, and trying to figure how I can implement this.</p>
  
  <p>My root index.js looks like:</p>
  
  <pre><code>require('core-js/client/shim');
  require('zone.js/dist/zone');
  
  require('@angular/common');
  require('rxjs');
  
  require('bootstrap')
  require('./index.scss');
  
  var ngCore = require('@angular/core');
  var ngPbd = require('@angular/platform-browser-dynamic');
  var AppModule = require('./app');
  
  if (process.env.NODE_ENV === 'production') {
      ngCore.enableProdMode();
  } else {
      Error['stackTraceLimit'] = Infinity; // eslint-disable-line dot-notation
      require('zone.js/dist/long-stack-trace-zone');
  }
  
  ngPbd.platformBrowserDynamic().bootstrapModule(AppModule);
  </code></pre>
  
  <p>Then my index.js for app is:</p>
  
  <pre><code>var bootstrap = require('bootstrap');
  var ng = require('@angular/core');
  var ngPlatformBrowser = require('@angular/platform-browser');
  var uiRouter = require('ui-router-ng2');
  var fa = require('font-awesome-loader');
  
  var myRoutes = require('./routes');
  var mainComponent = require('./main');
  
  module.exports = uiRouter.UIRouterModule({
      imports: [
          ngPlatformBrowser.BrowserModule
      ],
      declarations: [
          mainComponent
      ],
      providers: [
          uiRouter.provideUIRouter({ configClass: myRoutes.MyUIRouterConfig })
      ],
      states: myRoutes.STATES,
      bootstrap: [uiRouter.UIView]
  })(
      ng.Class({
          constructor: function() {}
      })
  );
  </code></pre>
  
  <p>Any suggestions and help to get me to a better point with this? Is this simply a typescript thing?</p>
  
  <p>Thanks much.</p>