0

I am trying to make an app in ruby and angular. While I am trying to create my controller and defining the new module i get this error in console : Uncaught ReferenceError: require is not defined

I am using Cloud9 online IDE and when I define the module

var app = angular.module('angularExample');

It says that angular is not defined. Angular is here:

myapp/app/assets/javascripts/angular

While the controller is here:

myapp/app/assets/javascripts/invoices/InvoiceCtrl.js

Application.js content:

//= require angular
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .

What am I doing wrong?

Daniel
  • 3,541
  • 3
  • 33
  • 46
Flav Flavius
  • 113
  • 1
  • 8
  • https://stackoverflow.com/questions/23603514/javascript-require-function-giving-referenceerror-require-is-not-defined – Abhi Aug 03 '17 at 15:32
  • Tag [tag:angular] is for Angular 2+, the tag [tag:angularjs] is for angular 1.x, please remove the incorrect tag :) – 0mpurdy Aug 03 '17 at 15:36
  • @0mpurdy that does not work :"couldn't find file 'angularjs' with type 'application/javascript'" – Flav Flavius Aug 03 '17 at 16:14
  • @FlavFlavius Sorry, I was referring to the tags in your Stack Overflow question - not the code that is causing the problem – 0mpurdy Aug 03 '17 at 16:57

0 Answers0