Is ObjectPath.js necessary for Angular Schema Form to work? - angular-schema-form

I am trying to dynamically generate a form from JSON data. I found Angular Schema Form to handle this, but I couldn't get it to work. I kept getting this injection failed error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module MIS due to:
Error: [$injector:modulerr] Failed to instantiate module schemaForm due to:
TypeError: Cannot read property 'parse' of undefined
So I looked around for the answer, and found a working Plunk. As I was adapting it to better show my situation, I noticed that when I removed Object-path.js the plunk got my same error.
I went back the Angular Schema Form docs to see if I had missed it being required, but can't find any mention of it.
Is there something that would tell me about the required dependencies?
OR
Does ASF not require Object-Path, and I'm doing something else wrong?
Again, here's my plunk, if you comment out the Object-Path script you can see what I mean.

#travis-heeter you can find a list of dependencies in the package.json file. It lists "objectpath": "^1.2.1" as a dependency.
The readme file also includes an example header in the script loading section showing the script tags to include. This section should also be added to the docs for people who go to the docs directly.
In the alphas for version 1.0.0 the objectpath library is built into the JSON Schema Form Core library, removing it from the dependency list of Angular Schema Form itself.
Note: There are two libraries called ObjectPath the one you linked to is not the one included. The NPM entry is for objectpath while the one you linked to is object-path with a hyphen.

Related

CI/CD pipeline deployment of AngularJS1.5.11 to azure websites giving error "Failed to instantiate module app.core due to Unknown provider: ENV_VARS"

after deploying the "AngularJs_1.5.11" app to "azure-websites" using "azure-devops" continuous-integration and deployment gives error:
[$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.core due to:
Error: [$injector:unpr] Unknown provider: ENV_VARS
below is the screenshot of the error while accessing the AngularJS azure-website :
also find below screenshot of my build pipeline in azure-devops which deploys AngularJS application build to "azure-websites"
below screenshot is my application code in VSCode
I just started working on this new project which uses AngularJS_1.5.11 so I have no clue what is going wrong. I tried these links
unknown ENV provider in AngularJS from stack but as I am new to AngularJS I have no idea where to apply the changes in my code mentioned in the link.
Any suggestions would be of great help.
Edit:
#Mark if you look at the screenshots below you will come to know how we are setting "ENV_VARS" in the code using "gulp.js, env.config.js, config.json" file
Edit1:
#Mark please find the screenshot of the 'config.js' file which gets created in the gulp task 'ng-config' using source file 'config.json' under "./src/client/app/config.js"
Here are the docs regarding the knowledge relevant to this issue.
Somewhere in your program, it is trying to reference one or more members defined in an angular provider registered as "ENV_VARS". Providers are angularjs objects that are available during compile time (see the table row for "object available in config phase" in this SO answer)
I would search the source of the application to see if this provider was further configured elsewhere (you can search by its name 'ENV_VARS') as it may not be getting sent over with your other source files.
To attempt a quick fix:
On the first line of your app.module.js, change it to this
angular.module('app.config', []).constant("ENV_VARS", {});
This will likely result in another error, but it should pinpoint you to what is trying to access this provider. I'm assuming this is either inherited code or from a purchased template so you may want to investigate the sources to that if possible.

Error occurred when request service 'AddModule'

After upgrading to DNN 9, I get the following error when I try to place modules on the page:
`Error occurred when request service 'AddModule'.
With most of my modules, if I refresh the page after getting the error, the module appears "hovering" and ready to be placed on the page. But with one custom module I created using Christoc's custom module templates, nothing happens when I refresh so it's impossible to place the module on a page.
What can I do to fix this error?
It's been a while. But I had a similar problem. In my case the problem was an extra entry in the <moduleDefinitions> node of the .dnn file. Like a reference to an ascx file that was part of the original template, but was deleted by me, but not from the .dnn file.
It seems DNN 9 is much more strict when it comes to modules and adding them.

Ionic 2 angular-2-in-memory-web-api 404 error

I've been developing a simple app in Ionic 2 and I tried using mock service (in-memory web API) for fetching data as described in this Angular 2 tutorial. My console reported this error:
TypeScript error: app/app.ts(11,49): Error TS2307: Cannot find module
'angular2-in-memory-web-api'.
I tried this solution: angular2-in-memory-web-api 404 error. After running this: npm i angular2-in-memory-web-api --save, I was unable to find the files where I was supposed to use the code provided in the rest of the solution.
How can I fix this? Sorry if the question is not posed quite right, this is my first one. Please ask if any additional information is needed. The problem is pretty much the same as the one for which the solution was provided in the link above, except that using Ionic 2 makes the given solution inapplicable in my case. I'm don't think SystemJS is being used, please see my file structure image.
Image of my file structure.

When I try to include the chart.js and angular chartjs files, I get: ReferenceError: require is not defined

I am working on an angularjs site - angular is already included. We have code that loops through js scripts in a specific folder and adds them to a bundle, so the script references get emitted on the main page (we are using single page architecture).
I have not explicitly tried to invoke the code, it is currently just getting included, yet when I bring up my site, I now get the following js errors:
Uncaught ReferenceError: require is not defined
and it's happening here:
var gulp = require('gulp'),
I did not use bower to install - I just pulled the source and dropped the folders into the folder that gets parsed for emitting the js scripts.
Is there something else I need to install?
shershen, that is what I came to realize.
I removed all the misc files in the folder and just left the Chart.min.js and the angular-chart.min.js files and then I was good to go.

AngularJS loaded twice with Rails asset pipeline

I have set up rails to use bower according to the following guide: http://joelencioni.com/blog/2014/01/03/integrating-bower-with-rails/
I have installed AngularJS and included it in my application.js file.
Now, when I run rake assets:precompile, I get the following error in the console:
WARNING: Tried to load angular more than once.
But my application continues to (seemingly) work fine. When I run rake assets:clobber, I no longer get the error.
I read through the many StackOverflow questions and answers relating to this error and still couldn't find a solution. ng-app is only declared once, there are no errors with my templates and how I include them, turbolinks is removed, etc.
What could cause this error when I compile my assets?
UPDATE: Some strange behaviour here... running the app in production with Passenger, the above error doesn't show up.

Resources