Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 30 15:12
    bbrink68 commented #2049
  • Aug 23 13:34
    SouravKumar89 edited #2058
  • Aug 23 13:27
    SouravKumar89 opened #2058
  • Aug 22 00:04

    PatrickJS on master

    Update README.md (compare)

  • Aug 13 17:17
    ramsunvtech commented #1925
  • Aug 12 22:58
    terrancecorley commented #770
  • Aug 09 02:30
    jindovu commented #2049
  • Aug 09 02:22
    jindovu opened #2057
  • Aug 08 10:49
    krawinkelm commented #2053
  • Jul 21 14:14
    FilipLitwora commented #958
  • Jul 21 14:14
    FilipLitwora commented #958
  • Jul 21 14:14
    FilipLitwora commented #958
  • Jul 09 11:40
    Sanafan commented #1713
  • Jul 05 11:41
    hoang-innomizetech commented #2053
  • Jul 05 07:32
    Jilaba commented #1824
  • Jun 29 04:31
    Jason-Cooke synchronize #2055
  • Jun 28 14:51
    jesslilly commented #1827
  • Jun 12 18:16
    dvaldivia commented #1969
  • Jun 12 17:55
    dvaldivia commented #2049
  • Jun 12 07:51
    ppomet commented #2056
gakam clovis
@clovisgakam
but don't know why webpack don't take the image during the building process
this is content of my webpack configuration file
gakam clovis
@clovisgakam
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var helpers = require('./helpers');

module.exports = {
  entry: {
    'polyfills': './src/polyfills.ts',
    'vendor': './src/vendor.ts',
    'app': './src/main.ts'
  },

  resolve: {
    extensions: ['.ts', '.js']
  },

  module: {
    rules: [
      {
        test: /\.ts$/,
        loaders: [
          {
            loader: 'awesome-typescript-loader',
            options: { configFileName: helpers.root('src', 'tsconfig.json') }
          } , 'angular2-template-loader'
        ]
      },
      {
        test: /\.html$/,
        loader: 'html-loader'
      },
      {
        test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
        loader: 'file-loader?name=assets/img/[name].[hash].[ext]'
      },
      {
        test: /\.css$/,
        exclude: helpers.root('src', 'app'),
        loader: ExtractTextPlugin.extract({ fallback: 'style-loader', loader: 'css-loader?sourceMap' })
      },
      {
        test: /\.css$/,
        include: helpers.root('src', 'app'),
        loader: 'raw-loader'
      }
    ]
  },

  plugins: [
    // Workaround for angular/angular#11580
    new webpack.ContextReplacementPlugin(
      // The (\\|\/) piece accounts for path separators in *nix and Windows
      /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/,
      helpers.root('./src'), // location of your src
      {} // a map of your routes
    ),

    new webpack.optimize.CommonsChunkPlugin({
      name: ['app', 'vendor', 'polyfills']
    }),

    new HtmlWebpackPlugin({
      template: 'src/index.html'
    })
  ]
};
Girish Rathod
@RathodGirish
I am using angular2-google-maps. That is not compatible with AOT.
May I get the solution. I want to reduce my bundle.js file.
I am using this command.
  ng build --prod --aot
niranjan0586
@niranjan0586
Hi
Is there any anyway to call typescript function from a external javascript
Sarath DR
@sarathdr
hi is it possible to increase TCP read timeout with angular2 http request
something we set for xhr.timeout = 1000
Stanislaus
@lanocturne
Anyone having these test errors now: AngularClass/angular2-webpack-starter#1628 ?
Alexander B.
@alexanderbelko
Hi
How to add PrimeNG (or other package) to the project?
Alexander B.
@alexanderbelko
AngularClass/angular2-webpack-starter#1380
Alexander B.
@alexanderbelko
I've done npm install --save primeng
But when I try to use any component, getting error: Error: Template parse errors: 'p-accordionTab' is not a known element: 1. If 'p-accordionTab' is an Angular component, then verify that it is part of this module.
NIkunj Baid
@Nik29
hey . I am unable to run ng generate component name . The error is : Unable to read property '0' of undefined. I am using @angular/cli@latest . OS: Windows 8.1 Angular 6.9.0 . npm :3.10.10 . Please help.
Forrest Murray
@FMurray
how to I get more descriptive stack traces? It seems like the dll is obscuring a lot
EXCEPTION: Uncaught (in promise): Error: Error in ./ProductComponent class ProductComponent - inline template:62:13 caused by: Cannot read property '0' of undefined
Error: Error in ./ProductComponent class ProductComponent - inline template:62:13 caused by: Cannot read property '0' of undefined
    at ViewWrappedError.ZoneAwareError (http://localhost:3000/polyfills.dll.js:4731:33)
    at ViewWrappedError.BaseError [as constructor] (http://localhost:3000/vendor.dll.js:28595:16)
    at ViewWrappedError.WrappedError [as constructor] (http://localhost:3000/vendor.dll.js:28660:16)
    at new ViewWrappedError (http://localhost:3000/vendor.dll.js:58640:16)
    at CompiledTemplate.proxyViewClass.DebugAppView._rethrowWithContext (http://localhost:3000/vendor.dll.js:80035:23)
    at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/vendor.dll.js:80008:18)
    at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (http://localhost:3000/vendor.dll.js:79795:18)
    at CompiledTemplate.proxyViewClass.View_ProductComponent_Host0.detectChangesInternal (/AppModule/ProductComponent/host.ngfactory.js:29:19)
    at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3000/vendor.dll.js:79810:14)
    at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3000/vendor.dll.js:80005:44)
    at ViewRef_.detectChanges (http://localhost:3000/vendor.dll.js:59572:20)
    at RouterOutlet.activate (http://localhost:3000/vendor.dll.js:65112:42)
    at ActivateRoutes.placeComponentIntoOutlet (http://localhost:3000/vendor.dll.js:23665:16)
    at ActivateRoutes.activateRoutes (http://localhost:3000/vendor.dll.js:23632:26)
    at http://localhost:3000/vendor.dll.js:23568:58
    at Array.forEach (native)
    at ActivateRoutes.activateChildRoutes (http://localhost:3000/vendor.dll.js:23568:29)
    at ActivateRoutes.activate (http://localhost:3000/vendor.dll.js:23542:14)
    at http://localhost:3000/vendor.dll.js:23110:22
    at SafeSubscriber._next (http://localhost:3000/vendor.dll.js:171:21)
    at SafeSubscriber.__tryOrSetError (http://localhost:3000/vendor.dll.js:600:16)
    at SafeSubscriber.next (http://localhost:3000/vendor.dll.js:542:27)
    at Subscriber._next (http://localhost:3000/vendor.dll.js:493:26)
    at Subscriber.next (http://localhost:3000/vendor.dll.js:457:18)
YUCK
hitoz
@hitoz
Hello there
hitoz
@hitoz

i am using angular in memory web api package on my project that build based on angular2 webpack starter,

i am using lazy loading for each submodules, i realized that every submodule will be loaded when the app is navigating somewhere..
the problem is, i import my angular in memory web api inside the submodule, to use the mockup API..
after i saved the data on mockup API, its working.. but when i navigate to somewhere else, the data will be reset (I think this is because we reload submodule again)..

For example:
I am going to update User, i am doing PUT 'api/users/5';
if i am not redirect to anywhere, the data will be keep..

but when i am going to navigate to list of user GET 'api/users';
the data will be reset because the module will be reload again..

FYI, update user form and list of user view is in a same module, why it load twice ? should be once right ?

roded
@roded
Hello, I'm wondering what's the best practice for the following scenario: I'd like to use the zxcvbn library in my ng2-webpack-starter app. (zxcvbn is a password-strengh js library distributed via npm, there's also the TypeScript def file for it on github somewhere). Thing is, as the library is several 00s kbytes in size and should be used from a minimal set of pages in the application, I'd like to load it dynamically and not bundle it with the whole app via webpack. Is there a recommended method of accomplishing this? Much obliged & thanks
donald-slagle
@donald-slagle
Does anyone know why my styles are not being applied? I can see the exports.push section in main.bundle.js that contains all the compiled styles from my sass files. This includes bootstrap, but basic classes like row do not have any bootstrap styles applied. I'm using the default loader configuration that comes with the started project.
donald-slagle
@donald-slagle
I have import 'assets/sass/app.scss'; added to main.browser.ts.
alisherabd
@alisherabd
after I run "npm run build:docker" and the image is ready locally, what shpuld I do next?
perrierism
@perrierism
having a lot of trouble getting some 3p libraries into an app here here ... for instance moment.js :
it provides it's own typings but any import / require I try doesn't get it defined in the app.
where it seems I can just do import {MomentModule} from 'angular2-moment'; ... which doesn't raise any errors, but, MomentModule is still not defined ...
anyone use moment, or have any pointers on how to import a module like this?
Forrest Murray
@FMurray
@alexanderbelko did you add primeeng to your app.module ?
@perrierism where is MomentModule not defined?
@donald-slagle are you trying to load global styles?
@alisherabd what are you trying to accomplish with your docker image?
webdev48
@webdev48
I am using this starter kit trying to read a simple json file from a service...it throws 404
can anyone help?
export class MyService {

  public data:any;

  constructor(private http:Http) {
    this.http.get('/data/settings.json')
      .subscribe(res => this.data = res.json());
  }
}
Forrest Murray
@FMurray
@webdev where are you using the service? did you add it to the providers?
webdev48
@webdev48
yes all of that is fine... obviously i am consuming it in a component

@Component({
  selector: 'home',  // <home></home>
  providers: [
    MyService
  ],
  styleUrls: [ './home.component.css' ],
  templateUrl: './home.component.html'
})
export class HomeComponent implements OnInit {

  // TypeScript public modifiers
  constructor(
    public myService: MyService
  ) {
    console.log(myService.data);

  }
}
Forrest Murray
@FMurray
Is that all the code? \
You need to use @Injectable decorator I believe
webdev48
@webdev48
im using that as well on the service
Forrest Murray
@FMurray
.subscribe(res => this.data = res.json().data)
webdev48
@webdev48
already doing that in the service if you look above ^^ and it does not need .data in the end
its a 404 dude EXCEPTION: Response with status: 404 Not Found for URL: http://localhost:4000/data/settings.json
Carlos Esteban Lopez Jaramillo
@luchillo17
Anyone can explain me what does this do in webpack config?
// Fix Angular 2
      new NormalModuleReplacementPlugin(
        /facade(\\|\/)async/,
        helpers.root('node_modules/@angular/core/src/facade/async.js')
      ),
      new NormalModuleReplacementPlugin(
        /facade(\\|\/)collection/,
        helpers.root('node_modules/@angular/core/src/facade/collection.js')
      ),
      new NormalModuleReplacementPlugin(
        /facade(\\|\/)errors/,
        helpers.root('node_modules/@angular/core/src/facade/errors.js')
      ),
      new NormalModuleReplacementPlugin(
        /facade(\\|\/)lang/,
        helpers.root('node_modules/@angular/core/src/facade/lang.js')
      ),
      new NormalModuleReplacementPlugin(
        /facade(\\|\/)math/,
        helpers.root('node_modules/@angular/core/src/facade/math.js')
      ),
Carlos Esteban Lopez Jaramillo
@luchillo17
Ok seems nobody will answer the last one, how about this one, i've tested the AoT with @ngtools/webpack and it looks simpler than the one used in this repo at this moment, is there any good reason to stick with ngc-webpack?
alisherabd
@alisherabd
@FMurray I just wanted to see docker container in use. Let's say I have this production image, how do I load it locally with docker and see on browser, before deploying to cloud?