Giter Site home page Giter Site logo

Comments (11)

jkufrin avatar jkufrin commented on May 12, 2024 2

@NathanWalker
I finally figured it out. I'm running Quickstart ng2-rc1 inside a VS2015 project. I moved @angular and angulartics into my wwwroot/libraries folder.

The map and package objects needed to be updated from what you show in your Readme documenation.

Here's a snippet from my updated systemjs.config.js file:
var map = {
'app': 'app',
'rxjs': 'libraries/rxjs',
'angular2-in-memory-web-api': 'libraries/angular2-in-memory-web-api',
'@angular': 'libraries/@angular',
'moment': 'libraries/moment/min/moment.min.js',
'angulartics2': 'libraries/angulartics2'
};
var packages = {
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { defaultExtension: 'js' },
'moment': { type: 'cjs', defaultExtension: 'js' },
'angulartics2': { main: 'index.js', defaultExtension: 'js' }
};

from angulartics2.

marcusfalley avatar marcusfalley commented on May 12, 2024 2

@jkufrin Your most recent comment with 'angulartics2': { main: 'index.js', defaultExtension: 'js' } and in particular the main: 'index.js' fixed my similar issue. Thank you!

from angulartics2.

jkufrin avatar jkufrin commented on May 12, 2024

@rbaarsma did you ever figure this out? I'm seeing the same thing.

from angulartics2.

NathanWalker avatar NathanWalker commented on May 12, 2024

@jkufrin @rbaarsma You can likely follow this guide which I wrote to get ng2-dragula setup with system register format and QuickStart guide. Similar setup and changes would be needed for this lib as well:
https://github.com/valor-software/ng2-dragula/wiki#5-min-quickstart

from angulartics2.

jkufrin avatar jkufrin commented on May 12, 2024

@NathanWalker
Awesome. Thanks for the fast reply.

I just updated to the latest specs from https://angular.io/docs/ts/latest/quickstart.html, "angular2": "2.0.0-beta.15", etc...
I've got it working up until the point where I add Angulartics2GoogleAnalytics to the component providers. As soon as I add that, I get 2 errors in my console:

system.src.js:4935
GET http://localhost:3000/libraries/angular2/angulartics2.js/src/providers/angulartics2-google-analytics 404 (Not Found)

angular2-polyfills.js:332
Error: Error: XHR error (404 Not Found) loading http://localhost:3000/libraries/angular2/angulartics2.js/src/providers/angulartics2-google-analytics(…)

I can't tell why it's trying to concat the AGA path onto the end of the angulartics2.js

thanks

from angulartics2.

jkufrin avatar jkufrin commented on May 12, 2024

@NathanWalker
It's something with my System.config. I've tried all kinds of combinations of the code to try and include the libraries. You can see all the commented stuff I tried in my index below.

The paths stuff you mention in dragula did not work. I thought I was close when I tried using map, lines 41-42 on the attached index. It allows the main script to work, but it's also concatenating the google-analytics script and throwing that error up above.

I notice that you're using:
import {Component} from 'angular2/angular2';
which is old. I'm wondering if something else is going on with the main library that is effected since the master angular2 core code has changed?

I appreciate any help you could throw my way.

index.txt
main.txt
app.component.txt

from angulartics2.

NathanWalker avatar NathanWalker commented on May 12, 2024

If you have a github repo you could share with me, I may can help later with a PR.

from angulartics2.

rbaarsma avatar rbaarsma commented on May 12, 2024

@jkufrin nope didn't get it to work. In the end I simply put the pageview in my custom secure-router-outlet.ts and didn't bother with this bundle (except steal ideas from it's source code)

        // track google analytics pageview
        if (ga) {
            if (this._api.user) {
                ga('set', '&uid', this._api.user.id);
            }
            ga('send', 'pageview', instruction.urlPath);
        }

from angulartics2.

JonnyBGod avatar JonnyBGod commented on May 12, 2024

@rbaarsma not steeling ideas, the code is MIT, you are just learning one way of doing it. ;)

We should still try to help ease the use of this library for everyone. @NathanWalker I am assigning you to the issue as I am not familiar with quickstart or system.config. You probably can do it better.

Probably should add some reference to docs with proper configuration.

from angulartics2.

NathanWalker avatar NathanWalker commented on May 12, 2024

@jkufrin As mentioned, if you have a github project you could share, I could help further. Configuring SystemJS is very specific and dependent upon the entire setup you are working with so would need to see it in entirety to help further. Seeing bits and pieces often leaves out most important thing.

from angulartics2.

jkufrin avatar jkufrin commented on May 12, 2024

@NathanWalker Thanks for reaching out again. I appreciate it.
Unfortunately, I can't really post this project publicly. I did include a few of the files up above, with the extensions just switched from .ts to .txt so they could upload. You can see the first few steps of my project. I'm using all the latest stuff from https://angular.io/docs/ts/latest/quickstart.html, "angular2": "2.0.0-beta.15", etc...

I see that the repo was updated 4 days ago and again yesterday, with notes about updating it to beta.17. I will update my project to beta17 and get the latest version of angulartics2 and see if everything is working now.

from angulartics2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.