require is not defined in angular

后端 未结 1 421
青春惊慌失措
青春惊慌失措 2020-12-19 18:34

I am using angularjs where i have created a js file(loginCtrl.js) and i have inclused a controller. I have defined my db connection and schema in another file(server.js) and

1条回答
  •  时光说笑
    2020-12-19 19:24

    require() is a NodeJS function, your angular controller will be executed in the browser, which doesn't have that built-in function. If you want to replicate that behavior client-side, you should look at RequireJS

    0 讨论(0)
提交回复
热议问题