Bonjour, je suis entrain de développer un site e-commerce avec angular js, j'ai fait une vue pour le panier , il se trouve que les expression angualar ne marche pas ng-repeat non plus. ma vue s'appelle panier.php du que je transferts des données de php vers js . cordialement.
voici le code de la vue
Code html : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 
<?php
include_once("../caddi.php");
//echo($json);
    ?>
 
<script>
    var panier =JSON.stringify('<?php print_r( $json); ?>');
    localStorage.setItem('panier', panier);
    produits=panier.pLdc;
</script>
<script>
 
 
</script>
<input type="hidden" ng-init="articles=panier" >
<table class="table-bordered active">
    <caption class="banner-title"> Panier de {{articles.prenom articles.prenom}}</caption>
    <caption class="span8">ville: {{articles.ville}}</caption>
    <tr>
        <th>nom</th>
        <th>prix</th>
        <th>quantite</th>
        <th>montant</th>
 
    </tr>
    <tr ng-repeat="produit in produits">
        <td>{{produit.nom}}</td>
        <td>{{produit.prix}}</td>
        <td>{{produit.quantite}}</td>
        <td >{{produit.quantite * produit.prix}}</td>
        <td></td>
    </tr>
    <tr>
        <td class="col-lg-3">total</td>
        <td>{{produits.total}}</td>
    </tr>
 
</table>
 
1+5 = {{1+5}}
voici le code js
Code js : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
'use strict';
 
/**
 * @ngdoc overview
 * @name workspaceAngularApp
 * @description
 * # workspaceAngularApp
 *
 * Main module of the application.
 */
angular
    .module('workspaceAngularApp', [
 
        'ngRoute'
    ])
    .config(function ($routeProvider) {
        $routeProvider
            .when('/', {
                templateUrl: 'views/main.html',
                controller: 'MainCtrl'
            })
            .when('/about', {
                templateUrl: 'views/employes.html',
                controller: 'AboutCtrl'
            })
            .when('/panier', {
                templateUrl: 'views/pannier.php',
                controller: 'PanierCtrl'
            })
            .when('/inscription', {
                templateUrl: 'views/user.html',
                controller: 'UserCtrl'
            })
            .when('/forum', {
                templateUrl: 'views/forum.html',
// jscs:disable
// jscs:disable
                controller: 'ForumCtrl'
// jscs:enable
// jscs:enable
            })
            .when('/employes', {
                templateUrl: 'views/employes.html',
                controller: 'employe'
            })
            .when('/resultInscription', {
                templateUrl: 'views/ResultInscription.html',
                controller: 'AboutCtrl'
            })
            /*
             .when('/user', {
             templateUrl: 'views/user.html',
             controller: 'UserCtrl'
             })*/
            .otherwise({
                redirectTo: '/'
            });
    });
 
/**
 * @ngdoc function
 * @name workspaceAngularApp.controller:MainCtrl
 * @description
 * # MainCtrl
 * Controller of the workspaceAngularApp
 */
angular.module('workspaceAngularApp')
    .controller('MainCtrl', function ($scope) {
        $scope.awesomeThings = [
            'HTML5 Boilerplate',
            'AngularJS'
 
        ];
    });
 
 
 
var app = angular.module('workspaceAngularApp');
app.controller('PanierCtrl', ['$scope', '$http', function ($scope) {
 var panier=$scope.panier;
    console.log(panier);
 
    }]);


voici le rendu html
Nom : Capture.PNG
Affichages : 357
Taille : 30,1 KoPièce jointe 191430


cordialement.