Skip to content

Instantly share code, notes, and snippets.

@RobbertWolfs
Last active June 7, 2016 08:57
Show Gist options
  • Save RobbertWolfs/4c03ff1a27b042d3fb1d97c1b86445d7 to your computer and use it in GitHub Desktop.
Save RobbertWolfs/4c03ff1a27b042d3fb1d97c1b86445d7 to your computer and use it in GitHub Desktop.
import angular from 'angular';
import component from './home.view.js'; // this includes the home.view.js file and creates an angular 1.5 component below
const module = angular.module('app.shell.modules.home', []);
module.component('shellHome', component);
export default module.name;
import './home.scss';
class ShellHome {
/* @ngInject */
constructor($scope) {
$scope.cars = [{
id: 1,
name: 'Audi',
}, {
id: 2,
name: 'BMW',
}, {
id: 1,
name: 'Honda',
}];
$scope.selectedCar = [];
}
}
export default {
template: `
{{ selectedCar }}
<am-multiselect class="input-lg" multiple="true"
ms-selected ="There are {{selectedCar.length}} car(s) selected"
ng-model="selectedCar" ms-header="Select Some Cars"
options="c.id as c.name for c in cars"
change="selected()">
</am-multiselect>
`,
controller: ShellHome,
};
// OUR ANGULAR SETUP
import angular from 'angular';
import shell from './shell.js'; // it includes the shell.js file
import 'angular-multiselect/dist/multiselect-tpls'; // it includes the multiselect-tpls file
const module = angular.module('app', ['am.multiselect', shell]);
import angular from 'angular';
import shellHome from './home/index.js'; // this includes the home index.js file
const module = angular.module('app.shell.modules', [
shellHome
]);
export default module.name;
import angular from 'angular';
import modules from './modules/index.js'; // this iclides the modules index.js file
const module = angular.module('app.shell', [
modules,
]);
export default module.name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment