Celebrating 8 Successful Years
+1 (315)-715-8489

ng-if Else in Angularjs

Today i am going to share the code sample for angularjs ng-if else conditional Expression.
The angularjs not provide the if() {} else{} condition like others but we can achieve it by using the module.It is a collection of control flow directives like:
 
1. ng-if 
2. ng-if-else
3. ng-else 


Example Code Sample

<!DOCTYPE html> <html> <head> <script src="http://code.angularjs.org/1.2.0-rc.2/angularjs.js"></script> <script> function mainController($scope) { $scope.data = { FName: 'Yogendra', LName: 'Yadav' }; } </script> <body ng-app> <div ng-controller="mainController"> <h2>ng-if else in angularjs</h2> <div> <div ng-if="data.FName==='Yogendra'"> Employee Name: {{FName}} {{LName}} </div> <div ng-if="data.FName===' '"> Sample Code </div> </div> </div> </body> </html>

Yogendra - Software Developer

Executing Sql Scripts with Go Statements as CommandText

Here is the code lines for executing the sql script . we may get the errors while executing any string as CommandText that loaded with sql script. This causes due to the GO Statements. I'm providing these code lines to split that Go statements. Hope this is helpful to execute script file with Go Statements.


                 string sqlBatch = string.Empty;
                    script += "\nGO";
                    SqlCommand cmd = new SqlCommand("", conn);
                    foreach (string line in script.Split(new string[2] { "\n", "\r" }, StringSplitOptions.RemoveEmptyEntries))
                    {
                        if (line.ToUpperInvariant().Trim() == "GO")
                        {
 
                            cmd.CommandText = sqlBatch;
                            cmd.ExecuteNonQuery();
                            sqlBatch = string.Empty;
                        }
                        else
                        {
                            sqlBatch += line + "\n";
                        }
                    }‚Äč


Sai Venkat - Software Developer

Christmas and New Year Celebrations

Celebrations

At Skg Infosolutions we had a team building event on Christmas cheers and New year Revelry.which spread in our office,its not just the business indeed a best practice and deal making expertise that are being brought in great team bonding.