Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Anngular Coomend

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

tsc --init //get fichier parametre

tsc -w //compile toute les fichier


node nom_fichier

npm install -g json-server


json-server --watch db.json

//connect basse des donnes


nodemon mysqldata.js

ng g c nomfichier

// node js microservice
https://www.youtube.com/watch?
v=gF8IYisXByw&list=PLDmvslp_VR0xZGhJHMjy5dozCDJYZK6W-

//youssfi mohamed node js mongo +2


https://www.youtube.com/watch?v=-X_C1tS5-9Y

//youssfi mohamed angular +4


https://www.youtube.com/playlist?list=PLxr551TUsmAo457BgKV4dTzF__SUS5knW

//angular youness houdass +99


https://www.youtube.com/playlist?list=PLOxeTbzofqeVNCz8PdOEXjL8xMueFRV7n

//crud tutorial

//connect db with node js 1

https://www.youtube.com/watch?v=jKwz1-G4gwc

//affiche data and modidier ajouter suprimer 1

https://www.youtube.com/watch?v=ACsVNDIuKV8

//affiche data in table material 1


https://www.youtube.com/watch?v=jGbP620NahE

Pour récupérer des données avec une pagination côté backend node js with mysql
en Angular Materia
////////////
https://milkiya-api.lokabook.ma//bo/residences/solde

//controller

exports.allresidences=(req ,res)=>{
const bearer = req.headers.authorization.split(' ')[1];
let bearer_content = {};
try {
bearer_content = jwt_decode(bearer);
} catch {
return res.status(400).json({
error: 'the token is not valid'
});
}

let {id_residence}={...req.body}
console.log(id_residence)

let query =mysql.format(residence_model.allresidences ,[id_residence])


// console.log(query)
connection.query(query , (err, result) => {
if (!err) {

console.log(result)
let residences = result[result.length-1];

const response = {
residences : residences,
}
console.log(residences)
return res.status(200).json(response).end();}})

//model
const allresidences=`
set @id =? ;
SELECT date_creation FROM tab_residence_categorie WHERE
(@id IS NOT NULL AND id_residence_categorie = @id)
OR (@id IS NULL)

//route
//test
backofficeRouter.post("/residences",residence.allresidences);

/////////////////////////////////////////////////////////////////////// get data


from excele
//code permet de get data from fichier
// if(false){
// //read fichier and stock data in var data
// const reader = new FileReader();
// reader.readAsBinaryString(this.file)
// reader.onload = (e: any) => {
// const workbook = XLSX.read(reader.result, { type: 'binary' });
// const sheetNames = workbook.SheetNames;
// const data =
XLSX.utils.sheet_to_json(workbook.Sheets[sheetNames[0]]);
// this.data =data
// }
// }

//////////////////////////////////////////////////////////////////////////////////
date

set @id_compte =1
,@id_residence= null
,@date_debut=null
,@date_fin= null
,@type_autorisation="Longue" ;

select ta.* ,tr.nom_residence


from tab_residence_autorisation ta
INNER JOIN tab_param_residence tr
on tr.id_residence=ta.id_residence
where
ta.id_residence IN (SELECT taf.id_residence from tab_affectation taf
where taf.id_compte=@id_compte and (taf.code_role_compte ="GEST" or
taf.code_role_compte="ADMI")
and taf.flag_actif="O" and
taf.code_statut_affectation="VALI" )

AND IF(@id_residence IS NOT NULL, ta.id_residence, 1) = IF(@id_residence IS NOT


NULL, @id_residence, 1)
AND IF(@type_autorisation IS NOT NULL, ta.type_autorisation , 1) =
IF(@type_autorisation IS NOT NULL, @type_autorisation, 1) AND (@date_debut is null
or (@date_debut BETWEEN ta.date_debut and ta.date_fin) ) AND (@date_fin is null or
(@date_fin BETWEEN ta.date_debut and ta.date_fin) )

You might also like