problem with PrimeNG an visual studio 2015

UI Components for Angular
Post Reply
snarum
Posts: 5
Joined: 30 Mar 2016, 08:22

30 Mar 2016, 08:56

problem with PrimeNG an visual studio 2015

Hi

I'm having problems making the PrimeNG quickstart project (https://github.com/primefaces/primeng-quickstart) run on visual studio 2015/asp.net 5. Running the project with Lite works like a charm, but when I try to do the same in visual studio i get following error messages in the browser:

Code: Select all

GET http://localhost:36720/angular2/platform/browser 404 (Not Found)fetchTextFromURL 
 system.src.js:1085(anonymous function) 
Error: Error: XHR error (404 Not Found) loading http://localhost:36720/angular2/platform/browser(...)ZoneDelegate.invoke 
 angular2-polyfills.js:332Zone.run 
GET http://localhost:36720/angular2/core 404 (Not Found)fetchTextFromURL 
 system.src.js:1085(anonymous function) 
  system.src.js:1646ZoneAwarePromise 
(I've cut away most of the callstacks)

The changes I have done is adding this line to boot.ts:

Code: Select all

///<reference path="../node_modules/angular2/typings/browser.d.ts"/>
and added a gulp.js script to move npm packages from node_modules to wwwroot/libs/.

My best guess is that this has something to do with the system.Configure() section in the index.html file, but I haven't been able to figure out what.

Anybody that managed to get this to work in vs2015?

Any help will be appreciated.

Snorre

snarum
Posts: 5
Joined: 30 Mar 2016, 08:22

30 Mar 2016, 11:28

I found a solution to this. After changing my System.config section in index.html to the snippet below it works. It was kind of "Poke with a stick" trouble shooting from my side, so if anyone can suggest improvements to this, I will be greatfull:

Code: Select all

<script>
        System.config({

            packages: {
                appScripts: {
                    defaultExtension: 'js'
                },
                libs: {defaultExtension:'js'},
                "angular2": {"defaultExtension": false}
            },
            map: {
                'angular2' : 'libs/angular2',
                'primeng': 'libs/primeng'
            }
        });
      System.import('appScripts/boot').then(null, console.error.bind(console));
    </script>

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

30 Mar 2016, 11:29

I had a similar issue lately and the following config worked for me;

Code: Select all

<script>
        System.config({
            defaultJSExtensions: true,
            packages: {
                'app': {"defaultExtension": 'js'}
            },
            map: {
                'angular2': 'node_modules/angular2',
                'primeng': 'node_modules/primeng'
            }
        });
        System.import('app/boot').then(null, console.error.bind(console));
    </script>
The full page that is just updated is at;

https://github.com/primefaces/primeng-q ... index.html

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests