This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!(function(angular){ | |
var fakeServer = angular.module('fakeServer', ['inFoodApp', 'ngMockE2E']); | |
fakeServer.run([ | |
"$httpBackend", | |
function($httpBackend){ | |
var goods = {"4600974008956": {format:'EAN_13', name:'Геркулес', img: '', props: {protein: "12.3", oil:"6.2", carbohydrates: "61.8"}}}; | |
$httpBackend.when("GET", /ingridients\//).respond(function(method, url, params) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$http.get('/ingridients/').success(function (data) { | |
console.log("SUCCESS"); | |
if ( data.code !== 404 ){ | |
console.log(data); | |
} else { | |
console.log(data); | |
} | |
}).error(function (data, status, headers, config) { | |
console.log("FAIL2", arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="pleasePhoto" class="ng-cloak"> | |
<!-- Add new product header !--> | |
<div id="ingridientsHeader" style ="background-color: green; text-align: center; height: 110px;">Product Card</div> | |
<div id="photo_title_div" style ="background-color: grey; height: 320px;"> | |
<div id="photo_add_btn" style ="background-color: red; height: 100%; width: 50%; float: left; ">Add Photo</div> | |
<div id="photo_title_add_btn" style ="background-color: blue; height: 100%; width: 50%; float: right;">Add Title</div> | |
</div> | |
<div id="photo_main_container" style="padding: 40px; background-color: orange;"> | |
<div> | |
<h1>Nutrition Facts</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/Siyfion/angular-typeahead использовал это | |
верстка элемента | |
<input type="text" class="sfTypeahead" datasets="tempIngridientsList" ng-model="newIngridient"></input> | |
контроллер | |
-------------- | |
// при первой загрузке | |
$scope.tempIngridientsList = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters = {}; | |
parameters.image = "74dd8e31-d6aa-40dc-a1db-1e2fdf764ba3.jpg"; | |
parameters.name = $scope.title; | |
parameters.ingredients = []; | |
parameters.ingredients.push({ingredient: "fat", amount: $scope.totalFat, per: "g"}); | |
parameters.ingredients.push({ingredient: "calories", amount: $scope.calories, per: ""}); | |
parameters.ingredients.push({ingredient: "sodium", amount: $scope.sodium, per: "mg"}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive("myimgscroll", function(){ | |
return { | |
link: function(scope, element, attrs){ | |
scope.$watch('offset()', function(newval, oldval){ | |
console.log("bzbzbzbzbzzb:"); | |
}); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr ng-repeat="item in ingridients" class="photo_table_ingridients_row" ng-swipe-left="swipeIngridients('{{item.guid}}')" ng-swipe-right="swipeBackIngridients('{{item.guid}}')"> | |
<td ng-class="item.isSwiped ? 'container-swipe' : ''" > | |
<div ng-class="item.isSwiped ? 'ingridient-swipe-left-animation' : ''"> | |
<div class="left-ingidients-td">{{item.name}}</div> | |
<div class="right-ingidients-td"> | |
<div ng-show="item.effect" style="color: {{ingridientsColor[item.effect]}};">{{item.effect}}</div> | |
</div> | |
</div> | |
<div class="ingridient-delete-btn animate-show" ng-show="item.isSwiped" ng-click="deleteIngridients({{item.guid}})">Delete</div> | |
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr ng-repeat="item in ingridients" class="photo_table_ingridients_row ng-scope" ng-swipe-left="swipeIngridients(item.guid)" ng-swipe-right="swipeBackIngridients(item.guid)"> | |
<td ng-class="item.isSwiped ? 'container-swipe' : ''"> | |
<div ng-class="item.isSwiped ? 'ingridient-swipe-left-animation' : ''"> | |
<div class="left-ingidients-td ng-binding">"Краб"- ароматизаторы</div> | |
<div class="right-ingidients-td"> | |
<div ng-show="item.effect" ng-style="{color: ingridientsColor[item.effect]};" class="ng-binding" style="color: rgb(31, 31, 31);">Neutral</div> | |
</div> | |
</div> | |
<div class="ingridient-delete-btn animate-show ng-hide" ng-show="item.isSwiped" ng-click="deleteIngridients(item.guid)">Delete</div> | |
</td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.$watch('search', function() { | |
console.log($rootScope.searchIngridient); | |
console.log($scope.search); | |
$rootScope.loadingListView = true; | |
if($scope.firstLoading) { | |
$scope.firstLoading = false; | |
$rootScope.loadingListView = false; | |
} else { | |
parameters = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a module | |
angular.module('inFoodApp', ['ngTouch', 'ui.router.compat', 'angular-gestures', 'infinite-scroll', 'angular-carousel', | |
'ui.bootstrap']); /*, 'siyfion.sfTypeahead'*/ | |
//This configures the routes and associates each route with a view and a controller | |
angular.module('inFoodApp').config([ | |
"$stateProvider", | |
"$urlRouterProvider", | |
function ($stateProvider, $urlRouterProvider) { | |
var apiVersion = 1; |
OlderNewer