These are chat archives for AngularClass/NG6-starter

25th
Jan 2016
Rem
@rem-kl
Jan 25 2016 03:06

I'm having some trouble loading in a third-party directive (https://github.com/paradox41/angular-chartist.js/), getting a weird error.

Im including angular-chartist library in the main components file and then exporting that to my default app js - like so

components.js

import angular from 'angular';
import Home from './home/home';
import About from './about/about';
import Menu from './menu/menu';
import angularChartist from 'angular-chartist.js';

const componentModule = angular.module('app.components', [
  Menu.name,
  Home.name,
  About.name,
  'angular-chartist'
]);

export default componentModule;

app.js

import angular from 'angular';
import uiRouter from 'angular-ui-router';
import 'ionic-sdk/release/js/ionic.bundle';
import Components from './components/components';

angular.module('app', ['ionic', Components.name])

And i'm trying to include a chart that under the 'About' component

about.component.html

<div>
  <chartist class="ct-chart" chartist-data="vm.data" chartist-chart-type="Bar"></chartist>
</div>
class AboutController {
  constructor(factory) {
    this.name = 'ABOUT';
    this.data =[10,9,8,7,6,5];
  }
}

export default ['about.factory', AboutController];

Everything compiles, but when I go to the about route I get "Uncaught TypeError: Cannot read property 'map' of undefinedChartist.getDataArray @ bundle.js:100190createChart @ bundle.js:103247initialize @ bundle.js:101394"

any ideas would be awesome, im pretty noob with es6/angular