I'm questioning the use of a region id 5657 in my database for implementing if/else conditions.
1- Is it considered a bad practice to use an id for this purpose?
2- What would be the correct way to implement if/else conditions in this scenario?
ctrl.js
if( geoLocation.items ) {
$.each(geoLocation.parent(), function( index, location ) {
if( location.id === 5657 ) {
var disableItemId = 'disabled' + location.id;
// Get the model
var model = $parse( disableItemId );
// Assign a value to it
model.assign( $scope, false );
}
});
$.each( geoLocation.items, function( index, location ) {
var disableItemId = 'disabled' + location.id;
// Get the model
var model = $parse( disableItemId );
// Assign a value to it
model.assign( $scope, false );
});
}