I've encountered installation failures telling me I can't install Ionic Cordova resources due to lack of permissions, even though I'm an administrator.
Create a new component withionic g c list-user
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-list-user',
templateUrl: './list-user.component.html',
styleUrls: ['./list-user.component.scss'],
})
export class ListUserComponent implements OnInit {
constructor() { }
And this is the file app.module.ts
import { ListUser } from './list-user/list-user.component';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
@NgModule({
declarations: [AppComponent, ListUser],
ngOnInit() {}
}
This is the error I get:
compiler.js:2430 Uncaught Error: Unexpected value 'undefined' declared by the module 'AppModule'
at syntaxError (compiler.js:2430)
at compiler.js:18685
at Array.forEach (<anonymous>)
at CompileMetadataResolver.push../node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.getNgModuleMetadata (compiler.js:18683)
at
I want to make an app with ionic
and expressjs
, but I get this error:
This is the git of the project: https://github.com/hubmanS/GameStix
to raise the backend with nodemon server
and the frontend withionic server
I have this in app.js
the expressjs
.
var app = express();
const cors = require('cors');
app.use(cors());
app.options('*', cors());
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', 'http://localhost:8100');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type');
next();
}
app.use(allowCrossDomain);
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
and from ionic
I want to call backend
.
constructor(public http: HttpClient) {
super(http);
this.http.get(`http://localhost:3000/customers/`);
console.log('MENSAJE', this.http.get(`http://localhost:3000/customers`));
}
You are supposed to enter this router
.
router.get('/customers', function(req, res, next) {
console.log('NOMAS');
res.render('index', { title: 'Express' });
});
but the console
.
I am making an App in Ionic.
At one point in the App I need to press a button and close the current page I am on.
I do it in the following way:
- This is how I declare the button in the HTML view:
<button ion-button full (click)="guardarNuevoPerfil()">Guardar Perfil</button>
and this is the saveNewProfile() method of the Typescript part:
this.storage.get('listadoPerfiles').then((perfiles) => {
//Aquí guardo el perfil, justo despues necesito cerrar la página actual
window.close(); //No funciona
self.close(); //No funciona
});
As you can see in the code, I've tried window.close() and seslf.close() but it doesn't do anything, it doesn't close the tab.
This is the behavior I want to have:
I have searched in google and nothing has come up, practically everything that comes out in for Javascript.
I am trying to use a TCP connected socket in my Ionic 3 app.
To do this I follow the following steps:
1- I create an ionic app:
ionic start testTcp blank --cordova
2- I enter the application directory
cd testtcp
3- I install ionic-native (when creating the project I think it already includes it but I still install it again)
npm install ionic-native --save
4- I download the following plugin to install it from local instead of installing it from the repository, the downloaded plugin is the following: https://github.com/KoenLav/cordova-plugin-chrome-apps-sockets-tcp
5- I install the plugin in my application:
ionic cordova plugin add cordova-plugin-chrome-apps-sockets-tcp-master
So far everything is going well, if I look at the plugins that I have installed with the following command: ionic cordova plugin ls
it tells me that I have the plugin "cordova-plugin-..." installed, which is the one that I just installed.
The problem comes when using this plugin, when creating a socket and connecting to a host.
How do I use this plugin? Do I have to do an import in the home.ts file? How would this import?
Being an own plugin I don't see how to do it and I can't find documentation.
I've tried the tool plugman
but it won't even let me install the plugin.