Why does the open source reload function not work? - angularjs

I developed a new electron-angular project.
When I execute it everything is working fine.
But when I change something in the code, the executing does not updating. like I wrote a function that set x value to 3.
then I execute it and get the correct value. then I change the code to x=7 but still the executing shows x=3 until I close the electron window and execute again.
for this I find this command:
npm install electron-reload
and this code:
const electron = require('electron')
// Enable live reload for all the files inside your project directory
require('electron-reload')(__dirname);
then according to the website I found this stuff- it's supposed to be great. but it's not. can you help me with it?

Related

appropriate loader to handle this file type only inside nodemodules

I am getting this error when trying to open a react native project on the web using expo. If I run expo start and use the cellphone, everything works fine. This only happens when I try to run on the web.
image
Looks like the error is on the line onValueChanged?.(low, high, false); but only happens inside node modules. If I try to use the same syntax inside a file in my project, the compiler works fine. Does someone know how I can fix it?

Visual Studio Code does not track React Problems

I can't seem to tell Visual Studio Code to track problems in a Typescript React App. I did the following to reproduce:
yarn create react-app --template typescript test
code test
I've added the following to App.tsx:
public class Dummy {
public constructor() {
let x = 0;
}
}
When I run npm start, I get two warnings in the console, but the Problems pane remains empty. Introducing an error (let x = abc) shows a problem while the file is open, but not when it's closed (although it is shown in the terminal).
I've tried using the $eslint-stylish matcher, as well as the problem matcher here.
Your issue looks like issue 12073 (Errors from run npm script are not showed in 'Problems' pane)
It refers to vscode issue 1777 which states:
Looks like this went live with 1.14 (June 2017 update).
I actually came here looking to tone auto-detection down a bit -- it's detecting all my pre/post tasks as well as the ones I actually want to run. It looks like it selects "configured" tasks first, so this isn't a huge issue, but it'd be nice to be able to hide some NPM tasks completely (and/or not show pre/post tasks in the first place).
(fixed in 1.15)
The ReactJS tutorial suggests to configure the Chrome Debugger and display errors only in the Debug Console:

Angular 2 CLI project; when I change and save something in child component which is in a subdirectory, live server does not reload the page

Angular2 CLI project; Using Linux machine; Atom IDE
NG Live Development Server is running on http://localhost:4200,
When I change and save something in root or app component, server automatically detect the changes and reload the page and shows the effect of changes done in root component.
But when I change and save something in a child component which is only in a sub-directory of app directory, angular2 does not detect the changes or app does not reload.
Then I stop the server or app running (with ctrl c)and then run ng serve again to see the effect of changes. So each time I change or do something with child component , I do this unexpected work.
In Terminal, it does not complain about any error.
Anyone please help me, what is the problem.
The problem was related to inotify and I followed the instruction in the following links and restarted my computer, it works.
https://github.com/atom/atom/issues/2082
https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md#typeerror-unable-to-watch-path

Angular JS , putting the angular-1.2.27\docs\index.html to run

I'm starting to learn angularjs , but i found some things that didnt make sense for me. Im using chrome into a windows 8 machine.
First i downloaded the angularjs zip version from : https://angularjs.org/
folowing i did unzip the files in some directory.
Then i wanted to just take a look into the documentation into angular-1.2.27\docs\index.html.
The result is weird ,the menus doesnt works, the screen takes a long time to load and let it with a loading message into the middle of it.
Does it needs to be in a server ? since its all about javascrit it shouldnt work all by himself?
Well for anybody that arives here, the question i raised was a misundestand of the Tutorial and the other places i read about it.
In the case above, my mistake was that i suposed that i needed do run the npm install anywhere , but it should be run inside the project that needed the dependences that are related to.

Sencha touch app remains on blue loading screen when viewing on Android device or emulator

I just created a basic sencha app by
sencha generate app --name AndroidDemo --path ../demo
and I viewed it in browser and everything is perfect.
I then followed the instructions here: http://www.sencha.com/blog/android-setup-for-sencha-touch/
and compiled the app with Sencha Cmd and when the emulator opens I only get a blue loading screen.
I also tried compiling/building the app with phonegap on phonegap build site and the build finishes successfully and after loading the app in my andoid device, again I only see the loading page and it stays on this page and the app does not launch.
I'm completely clueless. Need your help friends.
Thanks,
In your app code may be miner syntax error or other error so while app run in emulator check log cat or other option run or app in chrome and check console log. Because loading screen display in case of error as my expression with this.
i'm having the exact same problem..
(currently on windows, btw)
while it's not exactly a solution,
a workaround that i did (out of desperation to see the rest of my app on the emulator):
is to just install it directly to the emulator using the "adb" command.
haven't tried this on a mac, but i'm guessing it's almost the same thing?
after building the app using "sencha" cmd, open cmd/terminal to the build directory.
-assuming you did not change the output location, the apk will be created in your
project root folder under this folder:
"build\native-package-mobile\MYAPPNAME\packager.json\"
make sure the emulator is already running
run the following in command/terminal at the folder where the apk is located:
adb install -r MYAPPNAME.apk
wait for awhile and it should say successfully installed.
run the app in the emulator and hopefully it will go beyond the loading screen.
I don't know why this issue is happening though.
(only started tinkering with android dev/sencha yesterday and it seems to be doing all in it's power to prevent me from running my app. haha)
please share if you find the correct fix for this :)
This usually happens when you build your version and you did not imbed all needed components.
For example, when you use ...
Ext.Image
... in your code.
While running without ...
Sencha app build xxx
... Sencha will grab the component from the touch/src components folder.
But at the time you build the app, it cannot reference to that folder any longer and Sencha will stall.
Please open the console and look out for a warning like this:
[WARN][Anonymous] [Ext.Loader] Synchronously loading 'Ext.MessageBox';
consider adding 'Ext.MessageBox' explicitly as a require of the
corresponding class
You need to add these to the requires section of either App.js or a class where you use the item (here Ext.Messagebox).
Another way to find out what is happening is to run the build code inside the browser and look into the console (so instead of localhost/myapp/index.html you run localhost/myapp/build/{package}/{myapp}/index.html).
There is one other thing that might happen. It’s the scope of async operations.
Like this:
Ext.defer(function() {this.log(‘all good’);}, 500);
this is not the scope of your class.
You need to use:
Ext.defer(function() {this.log(‘all good’);}, 500, this);
Or you might even use ...
Ext.bind()
...to bind the scope to the function.

Resources